home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 10 / AACD 10.iso / AACD / Games / MAME / src / drivers / toaplan2.c < prev    next >
C/C++ Source or Header  |  2000-04-23  |  83KB  |  2,389 lines

  1. /*****************************************************************************
  2.  
  3.         ToaPlan game hardware from 1991-1994
  4.         ------------------------------------
  5.         Driver by: Quench
  6.  
  7.  
  8. Supported games:
  9.  
  10.     ROM set        Toaplan
  11.     name        board No        Game name
  12.     --------------------------------------------------
  13.     tekipaki    TP-020            Teki Paki
  14.     ghox        TP-021            Ghox
  15.     dogyuun        TP-022            Dogyuun
  16.     kbash        TP-023            Knuckle Bash
  17.     tatsujn2    TP-024            Truxton 2 / Tatsujin 2
  18.     pipibibs    TP-025            Pipi & Bibis
  19.     whoopee        TP-025            Whoopee
  20.     pipibibi    bootleg            Pipi & Bibis
  21.     fixeight    TP-026            FixEight
  22.     vfive        TP-027            V-Five
  23.     batsugun    TP-030            Batsugun
  24.     snowbro2    ??????            Snow Bros. 2 - With New Elves
  25.  
  26.  Notes:
  27.     See Input Port definition header below, for instructions
  28.       on how to enter pause/slow motion modes.
  29.  
  30.  To Do / Unknowns:
  31.     - Whoopee/Teki Paki sometimes tests bit 5 of the territory port
  32.         just after testing for vblank. Why ?
  33.     - Whoppee is currently using the sound CPU ROM (Z80) from a differnt
  34.         (pirate ?) version of Pipi and Bibis (Ryouta Kikaku copyright).
  35.         It really has a HD647180 CPU, and its internal ROM needs to be dumped.
  36.     - Pipi and Bibis (Ryouta Kikaku copyright) Romset not supported yet.
  37.         CPU roms are encoded, and decoding needs to be worked out.
  38.  
  39. --- Game status ---
  40. Teki Paki     Working, but no sound. Missing sound MCU dump
  41. Ghox          Sprites are missing. Probably due to missing sound MCU dump.
  42. Dogyuun       Working, but no sound. MCU type unknown - its a Z?80 of some sort.
  43. Knuckle Bash  Working, but no sound. MCU dump exists, its a Z?80 of some sort.
  44. Tatsujin 2    Not Working.
  45. Pipi & Bibis  Working.
  46. Whoopee       Working. Missing sound MCU dump. Using bootleg sound CPU dump for now
  47. Pipi & Bibis  (bootleg ?)  Not working. 68K CPU ROMs are encoded ?
  48. FixEight      Not working.           MCU type unknown - its a Z?80 of some sort.
  49. VFive         Working, but no sound. MCU type unknown - its a Z?80 of some sort.
  50. Batsugun      Working, no sound, wrong GFX priorities. MCU type unknown - its a Z?80 of some sort.
  51. Snow Bros. 2  Working.
  52.  
  53. *****************************************************************************/
  54.  
  55.  
  56. #include "driver.h"
  57. #include "vidhrdw/generic.h"
  58. #include "cpu/m68000/m68000.h"
  59. #include "cpu/z80/z80.h"
  60.  
  61.  
  62. /**************** Machine stuff ******************/
  63. #define HD64x180 0        /* Define if CPU support is available */
  64. #define Zx80     0
  65.  
  66. #define CPU_2_NONE        0x00
  67. #define CPU_2_Z80        0x5a
  68. #define CPU_2_HD647180    0xa5
  69. #define CPU_2_Zx80        0xff
  70.  
  71. static unsigned char *toaplan2_shared_ram;
  72. static unsigned char *Zx80_shared_ram;
  73.  
  74. static int mcu_data = 0;
  75. int toaplan2_sub_cpu = 0;
  76. static INT8 old_p1_paddle_h;
  77. static INT8 old_p1_paddle_v;
  78. static INT8 old_p2_paddle_h;
  79. static INT8 old_p2_paddle_v;
  80.  
  81.  
  82.  
  83. /**************** Video stuff ******************/
  84. READ_HANDLER( toaplan2_0_videoram_r );
  85. READ_HANDLER( toaplan2_1_videoram_r );
  86. WRITE_HANDLER( toaplan2_0_videoram_w );
  87. WRITE_HANDLER( toaplan2_1_videoram_w );
  88.  
  89. WRITE_HANDLER( toaplan2_0_voffs_w );
  90. WRITE_HANDLER( toaplan2_1_voffs_w );
  91.  
  92. WRITE_HANDLER( toaplan2_0_scroll_reg_select_w );
  93. WRITE_HANDLER( toaplan2_1_scroll_reg_select_w );
  94. WRITE_HANDLER( toaplan2_0_scroll_reg_data_w );
  95. WRITE_HANDLER( toaplan2_1_scroll_reg_data_w );
  96.  
  97. void toaplan2_0_eof_callback(void);
  98. void toaplan2_1_eof_callback(void);
  99. int  toaplan2_0_vh_start(void);
  100. int  toaplan2_1_vh_start(void);
  101. void toaplan2_0_vh_stop(void);
  102. void toaplan2_1_vh_stop(void);
  103. void toaplan2_0_vh_screenrefresh(struct osd_bitmap *bitmap,int full_refresh);
  104. void toaplan2_1_vh_screenrefresh(struct osd_bitmap *bitmap,int full_refresh);
  105. void batsugun_1_vh_screenrefresh(struct osd_bitmap *bitmap,int full_refresh);
  106.  
  107. static int video_status = 0;
  108.  
  109.  
  110.  
  111. static void init_toaplan2(void)
  112. {
  113.     old_p1_paddle_h = 0;
  114.     old_p1_paddle_v = 0;
  115.     old_p2_paddle_h = 0;
  116.     old_p2_paddle_v = 0;
  117.     toaplan2_sub_cpu = CPU_2_HD647180;
  118.     mcu_data = 0;
  119. }
  120.  
  121. static void init_toaplan3(void)
  122. {
  123.     toaplan2_sub_cpu = CPU_2_Zx80;
  124.     mcu_data = 0;
  125. }
  126.  
  127. static void init_pipibibs(void)
  128. {
  129.     toaplan2_sub_cpu = CPU_2_Z80;
  130. }
  131.  
  132. static void init_snowbro2(void)
  133. {
  134.     toaplan2_sub_cpu = CPU_2_NONE;
  135. }
  136.  
  137. static int toaplan2_interrupt(void)
  138. {
  139.     return MC68000_IRQ_4;
  140. }
  141.  
  142. static WRITE_HANDLER( toaplan2_coin_w )
  143. {
  144.     switch (data & 0x0f)
  145.     {
  146.         case 0x00:    coin_lockout_global_w(0,1); break;    /* Lock all coin slots */
  147.         case 0x0c:    coin_lockout_global_w(0,0); break;    /* Unlock all coin slots */
  148.         case 0x0d:    coin_counter_w(0,1); coin_counter_w(0,0);    /* Count slot A */
  149.                     logerror("Count coin slot A\n"); break;
  150.         case 0x0e:    coin_counter_w(1,1); coin_counter_w(1,0);    /* Count slot B */
  151.                     logerror("Count coin slot B\n"); break;
  152.     /* The following are coin counts after coin-lock active (faulty coin-lock ?) */
  153.         case 0x01:    coin_counter_w(0,1); coin_counter_w(0,0); coin_lockout_w(0,1); break;
  154.         case 0x02:    coin_counter_w(1,1); coin_counter_w(1,0); coin_lockout_global_w(0,1); break;
  155.  
  156.         default:    logerror("Writing unknown command (%04x) to coin control\n",data);
  157.                     break;
  158.     }
  159.     if (data > 0xf)
  160.     {
  161.         logerror("Writing unknown upper bits command (%04x) to coin control\n",data);
  162.     }
  163. }
  164.  
  165. static WRITE_HANDLER( oki_bankswitch_w )
  166. {
  167.     OKIM6295_set_bank_base(0, ALL_VOICES, (data & 1) * 0x40000);
  168. }
  169.  
  170. static READ_HANDLER( toaplan2_shared_r )
  171. {
  172.     return toaplan2_shared_ram[offset>>1];
  173. }
  174.  
  175. static WRITE_HANDLER( toaplan2_shared_w )
  176. {
  177.     toaplan2_shared_ram[offset>>1] = data;
  178. }
  179.  
  180. static WRITE_HANDLER( toaplan2_hd647180_cpu_w )
  181. {
  182.     /* Command sent to secondary CPU. Support for HD647180 will be
  183.        required when a ROM dump becomes available for this hardware */
  184.  
  185.     if (toaplan2_sub_cpu == CPU_2_Z80)        /* Whoopee */
  186.     {
  187.         toaplan2_shared_ram[0] = data;
  188.     }
  189.     else                                    /* Teki Paki */
  190.     {
  191.         mcu_data = data;
  192.         logerror("PC:%08x Writing command (%04x) to secondary CPU shared port\n",cpu_getpreviouspc(),mcu_data);
  193.     }
  194. }
  195.  
  196. static READ_HANDLER( c2map_port_6_r )
  197. {
  198.     /* bit 4 high signifies secondary CPU is ready */
  199.     /* bit 5 is tested low before V-Blank bit ??? */
  200.     switch (toaplan2_sub_cpu)
  201.     {
  202.         case CPU_2_Z80:            mcu_data = toaplan2_shared_ram[0]; break;
  203.         case CPU_2_HD647180:    mcu_data = 0xff; break;
  204.         default:                mcu_data = 0x00; break;
  205.     }
  206.     if (mcu_data == 0xff) mcu_data = 0x10;
  207.     else mcu_data = 0x00;
  208.     return ( mcu_data | input_port_6_r(0) );
  209. }
  210.  
  211. static READ_HANDLER( video_status_r )
  212. {
  213.     /* video busy if bit 8 is low, or bits 7-0 are high ??? */
  214.     video_status += 0x100;
  215.     video_status &= 0x100;
  216.     return video_status;
  217. }
  218.  
  219.  
  220. static READ_HANDLER( ghox_p1_h_analog_r )
  221. {
  222.     INT8 value, new_value;
  223.     new_value = input_port_7_r(0);
  224.     if (new_value == old_p1_paddle_h) return 0;
  225.     value = new_value - old_p1_paddle_h;
  226.     old_p1_paddle_h = new_value;
  227.     return value;
  228. }
  229. static READ_HANDLER( ghox_p1_v_analog_r )
  230. {
  231.     INT8 new_value;
  232.     new_value = input_port_9_r(0);        /* fake vertical movement */
  233.     if (new_value == old_p1_paddle_v) return input_port_1_r(0);
  234.     if (new_value >  old_p1_paddle_v)
  235.     {
  236.         old_p1_paddle_v = new_value;
  237.         return (input_port_1_r(0) | 2);
  238.     }
  239.     old_p1_paddle_v = new_value;
  240.     return (input_port_1_r(0) | 1);
  241. }
  242. static READ_HANDLER( ghox_p2_h_analog_r )
  243. {
  244.     INT8 value, new_value;
  245.     new_value = input_port_8_r(0);
  246.     if (new_value == old_p2_paddle_h) return 0;
  247.     value = new_value - old_p2_paddle_h;
  248.     old_p2_paddle_h = new_value;
  249.     return value;
  250. }
  251. static READ_HANDLER( ghox_p2_v_analog_r )
  252. {
  253.     INT8 new_value;
  254.     new_value = input_port_10_r(0);        /* fake vertical movement */
  255.     if (new_value == old_p2_paddle_v) return input_port_2_r(0);
  256.     if (new_value >  old_p2_paddle_v)
  257.     {
  258.         old_p2_paddle_v = new_value;
  259.         return (input_port_2_r(0) | 2);
  260.     }
  261.     old_p2_paddle_v = new_value;
  262.     return (input_port_2_r(0) | 1);
  263. }
  264.  
  265. static READ_HANDLER( ghox_mcu_r )
  266. {
  267.     return 0xff;
  268. }
  269. static WRITE_HANDLER( ghox_mcu_w )
  270. {
  271.     data &= 0xffff;
  272.     mcu_data = data;
  273.     if ((data >= 0xd0) && (data < 0xe0))
  274.     {
  275.         offset = ((data & 0x0f) * 4) + 0x38;
  276.         WRITE_WORD (&toaplan2_shared_ram[offset  ],0x05);    /* Return address for */
  277.         WRITE_WORD (&toaplan2_shared_ram[offset-2],0x56);    /*   RTS instruction */
  278.     }
  279.     else
  280.     {
  281.         logerror("PC:%08x Writing %08x to HD647180 cpu shared ram status port\n",cpu_getpreviouspc(),mcu_data);
  282.     }
  283.     WRITE_WORD (&toaplan2_shared_ram[0x56],0x4e);    /* Return a RTS instruction */
  284.     WRITE_WORD (&toaplan2_shared_ram[0x58],0x75);
  285.  
  286.     if (data == 0xd3)
  287.     {
  288.     WRITE_WORD (&toaplan2_shared_ram[0x56],0x3a);    //    move.w  d1,d5
  289.     WRITE_WORD (&toaplan2_shared_ram[0x58],0x01);
  290.     WRITE_WORD (&toaplan2_shared_ram[0x5a],0x08);    //    bclr.b  #0,d5
  291.     WRITE_WORD (&toaplan2_shared_ram[0x5c],0x85);
  292.     WRITE_WORD (&toaplan2_shared_ram[0x5e],0x00);
  293.     WRITE_WORD (&toaplan2_shared_ram[0x60],0x00);
  294.     WRITE_WORD (&toaplan2_shared_ram[0x62],0xcb);    //    muls.w  #3,d5
  295.     WRITE_WORD (&toaplan2_shared_ram[0x64],0xfc);
  296.     WRITE_WORD (&toaplan2_shared_ram[0x66],0x00);
  297.     WRITE_WORD (&toaplan2_shared_ram[0x68],0x03);
  298.     WRITE_WORD (&toaplan2_shared_ram[0x6a],0x90);    //    sub.w   d5,d0
  299.     WRITE_WORD (&toaplan2_shared_ram[0x6c],0x45);
  300.     WRITE_WORD (&toaplan2_shared_ram[0x6e],0xe5);   //  lsl.b   #2,d1
  301.     WRITE_WORD (&toaplan2_shared_ram[0x70],0x09);
  302.     WRITE_WORD (&toaplan2_shared_ram[0x72],0x4e);    //    rts
  303.     WRITE_WORD (&toaplan2_shared_ram[0x74],0x75);
  304.     }
  305.  
  306. }
  307.  
  308. static READ_HANDLER( ghox_shared_ram_r )
  309. {
  310.     /* Ghox 68K reads data from MCU shared RAM and writes it to main RAM.
  311.        It then subroutine jumps to main RAM and executes this code.
  312.        Here, i'm just returning a RTS instruction for now.
  313.        See above ghox_mcu_w routine.
  314.  
  315.        Offset $56 and $58 is accessed around PC:F814
  316.  
  317.        Offset $38 and $36 is accessed from around PC:DA7C
  318.        Offset $3c and $3a is accessed from around PC:2E3C
  319.        Offset $40 and $3E is accessed from around PC:103EE
  320.        Offset $44 and $42 is accessed from around PC:FB52
  321.        Offset $48 and $46 is accessed from around PC:6776
  322.     */
  323.  
  324.     int data = READ_WORD (&toaplan2_shared_ram[offset]);
  325.  
  326.     return data;
  327. }
  328. static WRITE_HANDLER( ghox_shared_ram_w )
  329. {
  330.     WRITE_WORD (&toaplan2_shared_ram[offset],data);
  331. }
  332.  
  333.  
  334. static READ_HANDLER( kbash_sub_cpu_r )
  335. {
  336. /*    Knuckle Bash's  68000 reads secondary CPU status via an I/O port.
  337.     If a value of 2 is read, then secondary CPU is busy.
  338.     Secondary CPU must report 0xff when no longer busy, to signify that it
  339.     has passed POST.
  340. */
  341.     mcu_data=0xff;
  342.     return mcu_data;
  343. }
  344.  
  345. static WRITE_HANDLER( kbash_sub_cpu_w )
  346. {
  347.     logerror("PC:%08x writing %04x to Zx80 secondary CPU status port %02x\n",cpu_getpreviouspc(),mcu_data,offset/2);
  348. }
  349.  
  350. static READ_HANDLER( shared_ram_r )
  351. {
  352. /*    Other games using a Zx80 based secondary CPU, have shared memory between
  353.     the 68000 and the Zx80 CPU. The 68000 reads the status of the Zx80
  354.     via a location of the shared memory.
  355. */
  356.     int data = READ_WORD (&toaplan2_shared_ram[offset]);
  357.     return data;
  358. }
  359.  
  360. static WRITE_HANDLER( shared_ram_w )
  361. {
  362.     if (offset == 0x9e8)
  363.     {
  364.         WRITE_WORD (&toaplan2_shared_ram[offset + 2],data);
  365.     }
  366.     if (offset == 0xff8)
  367.     {
  368.         WRITE_WORD (&toaplan2_shared_ram[offset + 2],data);
  369.         logerror("PC:%08x Writing  (%04x) to secondary CPU\n",cpu_getpreviouspc(),data);
  370.         if ((data & 0xffff) == 0x81) data = 0x01;
  371.     }
  372.     WRITE_WORD (&toaplan2_shared_ram[offset],data);
  373. }
  374. static READ_HANDLER( Zx80_status_port_r )
  375. {
  376. /*** Status port includes Zx80 CPU POST codes. ************
  377.  *** This is actually a part of the 68000/Zx80 Shared RAM */
  378.  
  379.     int data;
  380.  
  381.     if (mcu_data == 0x800000aa) mcu_data = 0xff;        /* dogyuun */
  382.     if (mcu_data == 0x00) mcu_data = 0x800000aa;        /* dogyuun */
  383.  
  384.     if (mcu_data == 0x8000ffaa) mcu_data = 0xffff;        /* fixeight */
  385.     if (mcu_data == 0xffaa) mcu_data = 0x8000ffaa;        /* fixeight */
  386.     if (mcu_data == 0xff00) mcu_data = 0xffaa;            /* fixeight */
  387.  
  388.     logerror("PC:%08x reading %08x from Zx80 secondary CPU command/status port\n",cpu_getpreviouspc(),mcu_data);
  389.     data = mcu_data & 0x0000ffff;
  390.     return data;
  391. }
  392. static WRITE_HANDLER( Zx80_command_port_w )
  393. {
  394.     mcu_data = data;
  395.     logerror("PC:%08x Writing command (%04x) to Zx80 secondary CPU command/status port\n",cpu_getpreviouspc(),mcu_data);
  396. }
  397.  
  398. READ_HANDLER( Zx80_sharedram_r )
  399. {
  400.     return Zx80_shared_ram[offset / 2];
  401. }
  402.  
  403. WRITE_HANDLER( Zx80_sharedram_w )
  404. {
  405.     Zx80_shared_ram[offset / 2] = data;
  406. }
  407.  
  408.  
  409.  
  410. static struct MemoryReadAddress tekipaki_readmem[] =
  411. {
  412.     { 0x000000, 0x01ffff, MRA_ROM },
  413.     { 0x020000, 0x03ffff, MRA_ROM },                /* extra for Whoopee */
  414.     { 0x080000, 0x082fff, MRA_BANK1 },
  415.     { 0x0c0000, 0x0c0fff, paletteram_word_r },
  416.     { 0x140004, 0x140007, toaplan2_0_videoram_r },
  417.     { 0x14000c, 0x14000d, input_port_0_r },            /* VBlank */
  418.     { 0x180000, 0x180001, input_port_4_r },            /* Dip Switch A */
  419.     { 0x180010, 0x180011, input_port_5_r },            /* Dip Switch B */
  420.     { 0x180020, 0x180021, input_port_3_r },            /* Coin/System inputs */
  421.     { 0x180030, 0x180031, c2map_port_6_r },            /* CPU 2 busy and Territory Jumper block */
  422.     { 0x180050, 0x180051, input_port_1_r },            /* Player 1 controls */
  423.     { 0x180060, 0x180061, input_port_2_r },            /* Player 2 controls */
  424.     { -1 }
  425. };
  426.  
  427. static struct MemoryWriteAddress tekipaki_writemem[] =
  428. {
  429.     { 0x000000, 0x01ffff, MWA_ROM },
  430.     { 0x020000, 0x03ffff, MWA_ROM },                /* extra for Whoopee */
  431.     { 0x080000, 0x082fff, MWA_BANK1 },
  432.     { 0x0c0000, 0x0c0fff, paletteram_xBBBBBGGGGGRRRRR_word_w, &paletteram },
  433.     { 0x140000, 0x140001, toaplan2_0_voffs_w },
  434.     { 0x140004, 0x140007, toaplan2_0_videoram_w },    /* Tile/Sprite VideoRAM */
  435.     { 0x140008, 0x140009, toaplan2_0_scroll_reg_select_w },
  436.     { 0x14000c, 0x14000d, toaplan2_0_scroll_reg_data_w },
  437.     { 0x180040, 0x180041, toaplan2_coin_w },        /* Coin count/lock */
  438.     { 0x180070, 0x180071, toaplan2_hd647180_cpu_w },
  439.     { -1 }
  440. };
  441.  
  442. static struct MemoryReadAddress ghox_readmem[] =
  443. {
  444.     { 0x000000, 0x03ffff, MRA_ROM },
  445.     { 0x040000, 0x040001, ghox_p2_h_analog_r },        /* Paddle 2 */
  446.     { 0x080000, 0x083fff, MRA_BANK1 },
  447.     { 0x0c0000, 0x0c0fff, paletteram_word_r },
  448.     { 0x100000, 0x100001, ghox_p1_h_analog_r },        /* Paddle 1 */
  449.     { 0x140004, 0x140007, toaplan2_0_videoram_r },
  450.     { 0x14000c, 0x14000d, input_port_0_r },            /* VBlank */
  451.     { 0x180000, 0x180001, ghox_mcu_r },                /* really part of shared RAM */
  452.     { 0x180006, 0x180007, input_port_4_r },            /* Dip Switch A */
  453.     { 0x180008, 0x180009, input_port_5_r },            /* Dip Switch B */
  454.     { 0x180010, 0x180011, input_port_3_r },            /* Coin/System inputs */
  455. //    { 0x18000c, 0x18000d, input_port_1_r },            /* Player 1 controls (real) */
  456. //    { 0x18000e, 0x18000f, input_port_2_r },            /* Player 2 controls (real) */
  457.     { 0x18000c, 0x18000d, ghox_p1_v_analog_r },        /* Player 1 controls */
  458.     { 0x18000e, 0x18000f, ghox_p2_v_analog_r },        /* Player 2 controls */
  459.     { 0x180500, 0x180fff, ghox_shared_ram_r },
  460.     { 0x18100c, 0x18100d, input_port_6_r },            /* Territory Jumper block */
  461.     { -1 }
  462. };
  463.  
  464. static struct MemoryWriteAddress ghox_writemem[] =
  465. {
  466.     { 0x000000, 0x03ffff, MWA_ROM },
  467.     { 0x080000, 0x083fff, MWA_BANK1 },
  468.     { 0x0c0000, 0x0c0fff, paletteram_xBBBBBGGGGGRRRRR_word_w, &paletteram },
  469.     { 0x140000, 0x140001, toaplan2_0_voffs_w },
  470.     { 0x140004, 0x140007, toaplan2_0_videoram_w },    /* Tile/Sprite VideoRAM */
  471.     { 0x140008, 0x140009, toaplan2_0_scroll_reg_select_w },
  472.     { 0x14000c, 0x14000d, toaplan2_0_scroll_reg_data_w },
  473.     { 0x180000, 0x180001, ghox_mcu_w },                /* really part of shared RAM */
  474.     { 0x180500, 0x180fff, ghox_shared_ram_w, &toaplan2_shared_ram },
  475.     { 0x181000, 0x181001, toaplan2_coin_w },
  476.     { -1 }
  477. };
  478.  
  479. static struct MemoryReadAddress dogyuun_readmem[] =
  480. {
  481.     { 0x000000, 0x07ffff, MRA_ROM },
  482.     { 0x100000, 0x103fff, MRA_BANK1 },
  483.     { 0x200010, 0x200011, input_port_1_r },            /* Player 1 controls */
  484.     { 0x200014, 0x200015, input_port_2_r },            /* Player 2 controls */
  485.     { 0x200018, 0x200019, input_port_3_r },            /* Coin/System inputs */
  486. #if Zx80
  487.     { 0x21e000, 0x21fbff, shared_ram_r },            /* $21f000 status port */
  488.     { 0x21fc00, 0x21ffff, Zx80_sharedram_r },        /* 16-bit on 68000 side, 8-bit on Zx80 side */
  489. #else
  490.     { 0x21e000, 0x21efff, shared_ram_r },
  491.     { 0x21f000, 0x21f001, Zx80_status_port_r },        /* Zx80 status port */
  492.     { 0x21f004, 0x21f005, input_port_4_r },            /* Dip Switch A */
  493.     { 0x21f006, 0x21f007, input_port_5_r },            /* Dip Switch B */
  494.     { 0x21fc00, 0x21ffff, Zx80_sharedram_r },        /* 16-bit on 68000 side, 8-bit on Zx80 side */
  495. #endif
  496.     /***** The following in 0x30000x are for video controller 1 ******/
  497.     { 0x300004, 0x300007, toaplan2_0_videoram_r },    /* tile layers */
  498.     { 0x30000c, 0x30000d, input_port_0_r },            /* VBlank */
  499.     { 0x400000, 0x400fff, paletteram_word_r },
  500.     /***** The following in 0x50000x are for video controller 2 ******/
  501.     { 0x500004, 0x500007, toaplan2_1_videoram_r },    /* tile layers 2 */
  502.     { 0x700000, 0x700001, video_status_r },            /* test bit 8 */
  503.     { -1 }
  504. };
  505.  
  506. static struct MemoryWriteAddress dogyuun_writemem[] =
  507. {
  508.     { 0x000000, 0x07ffff, MWA_ROM },
  509.     { 0x100000, 0x103fff, MWA_BANK1 },
  510.     { 0x200008, 0x200009, OKIM6295_data_0_w },
  511.     { 0x20001c, 0x20001d, toaplan2_coin_w },
  512. #if Zx80
  513.     { 0x21e000, 0x21fbff, shared_ram_w, &toaplan2_shared_ram },    /* $21F000 */
  514.     { 0x21fc00, 0x21ffff, Zx80_sharedram_w, &Zx80_shared_ram },    /* 16-bit on 68000 side, 8-bit on Zx80 side */
  515. #else
  516.     { 0x21e000, 0x21efff, shared_ram_w, &toaplan2_shared_ram },
  517.     { 0x21f000, 0x21f001, Zx80_command_port_w },    /* Zx80 command port */
  518.     { 0x21fc00, 0x21ffff, Zx80_sharedram_w, &Zx80_shared_ram },    /* 16-bit on 68000 side, 8-bit on Zx80 side */
  519. #endif
  520.     /***** The following in 0x30000x are for video controller 1 ******/
  521.     { 0x300000, 0x300001, toaplan2_0_voffs_w },        /* VideoRAM selector/offset */
  522.     { 0x300004, 0x300007, toaplan2_0_videoram_w },    /* Tile/Sprite VideoRAM */
  523.     { 0x300008, 0x300009, toaplan2_0_scroll_reg_select_w },
  524.     { 0x30000c, 0x30000d, toaplan2_0_scroll_reg_data_w },
  525.     { 0x400000, 0x400fff, paletteram_xBBBBBGGGGGRRRRR_word_w, &paletteram },
  526.     /***** The following in 0x50000x are for video controller 2 ******/
  527.     { 0x500000, 0x500001, toaplan2_1_voffs_w },        /* VideoRAM selector/offset */
  528.     { 0x500004, 0x500007, toaplan2_1_videoram_w },    /* Tile/Sprite VideoRAM */
  529.     { 0x500008, 0x500009, toaplan2_1_scroll_reg_select_w },
  530.     { 0x50000c, 0x50000d, toaplan2_1_scroll_reg_data_w },
  531.     { -1 }
  532. };
  533.  
  534. static struct MemoryReadAddress kbash_readmem[] =
  535. {
  536.     { 0x000000, 0x07ffff, MRA_ROM },
  537.     { 0x100000, 0x103fff, MRA_BANK1 },
  538.     { 0x200000, 0x200001, kbash_sub_cpu_r },
  539.     { 0x200004, 0x200005, input_port_4_r },            /* Dip Switch A */
  540.     { 0x200006, 0x200007, input_port_5_r },            /* Dip Switch B */
  541.     { 0x200008, 0x200009, input_port_6_r },            /* Territory Jumper block */
  542.     { 0x208010, 0x208011, input_port_1_r },            /* Player 1 controls */
  543.     { 0x208014, 0x208015, input_port_2_r },            /* Player 2 controls */
  544.     { 0x208018, 0x208019, input_port_3_r },            /* Coin/System inputs */
  545.     { 0x300004, 0x300007, toaplan2_0_videoram_r },    /* tile layers */
  546.     { 0x30000c, 0x30000d, input_port_0_r },            /* VBlank */
  547.     { 0x400000, 0x400fff, paletteram_word_r },
  548.     { 0x700000, 0x700001, video_status_r },            /* test bit 8 */
  549.     { -1 }
  550. };
  551.  
  552. static struct MemoryWriteAddress kbash_writemem[] =
  553. {
  554.     { 0x000000, 0x07ffff, MWA_ROM },
  555.     { 0x100000, 0x103fff, MWA_BANK1 },
  556.     { 0x200000, 0x200003, kbash_sub_cpu_w },        /* sound number to play */
  557. //    { 0x200002, 0x200003, kbash_sub_cpu_w2 },        /* ??? */
  558.     { 0x20801c, 0x20801d, toaplan2_coin_w },
  559.     { 0x300000, 0x300001, toaplan2_0_voffs_w },
  560.     { 0x300004, 0x300007, toaplan2_0_videoram_w },
  561.     { 0x300008, 0x300009, toaplan2_0_scroll_reg_select_w },
  562.     { 0x30000c, 0x30000d, toaplan2_0_scroll_reg_data_w },
  563.     { 0x400000, 0x400fff, paletteram_xBBBBBGGGGGRRRRR_word_w, &paletteram },
  564.     { -1 }
  565. };
  566.  
  567. static struct MemoryReadAddress tatsujn2_readmem[] =
  568. {
  569.     { 0x000000, 0x07ffff, MRA_ROM },
  570.     { 0x100000, 0x10ffff, MRA_BANK1 },
  571.     { 0x200004, 0x200007, toaplan2_0_videoram_r },
  572.     { 0x20000c, 0x20000d, input_port_0_r },
  573.     { 0x300000, 0x300fff, paletteram_word_r },
  574.     { 0x400000, 0x403fff, MRA_BANK2 },
  575.     { 0x500000, 0x50ffff, MRA_BANK3 },
  576.     { 0x600000, 0x600001, video_status_r },
  577.     { 0x700000, 0x700001, input_port_4_r },            /* Dip Switch A */
  578.     { 0x700004, 0x700005, input_port_5_r },            /* Dip Switch B */
  579.     { 0x700006, 0x700007, input_port_6_r },            /* Territory Jumper block */
  580.     { 0x700008, 0x700009, input_port_3_r },            /* Coin/System inputs */
  581.     { 0x70000a, 0x70000b, input_port_0_r },            /* ??? whats this ? */
  582.     { 0x700016, 0x700017, YM2151_status_port_0_r },
  583.     { -1 }
  584. };
  585.  
  586. static struct MemoryWriteAddress tatsujn2_writemem[] =
  587. {
  588.     { 0x000000, 0x07ffff, MWA_ROM },
  589.     { 0x100000, 0x10ffff, MWA_BANK1 },
  590.     { 0x200000, 0x200001, toaplan2_0_voffs_w },        /* VideoRAM selector/offset */
  591.     { 0x200004, 0x200007, toaplan2_0_videoram_w },    /* Tile/Sprite VideoRAM */
  592.     { 0x200008, 0x200009, toaplan2_0_scroll_reg_select_w },
  593.     { 0x20000c, 0x20000d, toaplan2_0_scroll_reg_data_w },
  594.     { 0x300000, 0x300fff, paletteram_xBBBBBGGGGGRRRRR_word_w, &paletteram },
  595.     { 0x400000, 0x403fff, MWA_BANK2 },
  596.     { 0x500000, 0x50ffff, MWA_BANK3 },
  597. //    { 0x700010, 0x700011, OKIM6295_data_0_w },
  598.     { 0x700014, 0x700015, YM2151_register_port_0_w },
  599.     { 0x700016, 0x700017, YM2151_data_port_0_w },
  600.     { 0x70001e, 0x70001f, toaplan2_coin_w },        /* Coin count/lock */
  601.     { -1 }
  602. };
  603.  
  604. static struct MemoryReadAddress pipibibs_readmem[] =
  605. {
  606.     { 0x000000, 0x03ffff, MRA_ROM },
  607.     { 0x080000, 0x082fff, MRA_BANK1 },
  608.     { 0x0c0000, 0x0c0fff, paletteram_word_r },
  609.     { 0x140004, 0x140007, toaplan2_0_videoram_r },
  610.     { 0x14000c, 0x14000d, input_port_0_r },            /* VBlank */
  611.     { 0x190000, 0x190fff, toaplan2_shared_r },
  612.     { 0x19c020, 0x19c021, input_port_4_r },            /* Dip Switch A */
  613.     { 0x19c024, 0x19c025, input_port_5_r },            /* Dip Switch B */
  614.     { 0x19c028, 0x19c029, input_port_6_r },            /* Territory Jumper block */
  615.     { 0x19c02c, 0x19c02d, input_port_3_r },            /* Coin/System inputs */
  616.     { 0x19c030, 0x19c031, input_port_1_r },            /* Player 1 controls */
  617.     { 0x19c034, 0x19c035, input_port_2_r },            /* Player 2 controls */
  618.     { -1 }
  619. };
  620.  
  621. static struct MemoryWriteAddress pipibibs_writemem[] =
  622. {
  623.     { 0x000000, 0x03ffff, MWA_ROM },
  624.     { 0x080000, 0x082fff, MWA_BANK1 },
  625.     { 0x0c0000, 0x0c0fff, paletteram_xBBBBBGGGGGRRRRR_word_w, &paletteram },
  626.     { 0x140000, 0x140001, toaplan2_0_voffs_w },
  627.     { 0x140004, 0x140007, toaplan2_0_videoram_w },    /* Tile/Sprite VideoRAM */
  628.     { 0x140008, 0x140009, toaplan2_0_scroll_reg_select_w },
  629.     { 0x14000c, 0x14000d, toaplan2_0_scroll_reg_data_w },
  630.     { 0x190000, 0x190fff, toaplan2_shared_w, &toaplan2_shared_ram },
  631.     { 0x19c01c, 0x19c01d, toaplan2_coin_w },        /* Coin count/lock */
  632.     { -1 }
  633. };
  634.  
  635. static struct MemoryReadAddress fixeight_readmem[] =
  636. {
  637.     { 0x000000, 0x07ffff, MRA_ROM },
  638.     { 0x100000, 0x103fff, MRA_BANK1 },
  639.     { 0x200008, 0x200009, input_port_4_r },            /* Dip Switch A */
  640.     { 0x20000c, 0x20000d, input_port_5_r },            /* Dip Switch B */
  641.     { 0x200010, 0x200011, input_port_1_r },            /* Player 1 controls */
  642.     { 0x200014, 0x200015, input_port_2_r },            /* Player 2 controls */
  643.     { 0x200018, 0x200019, input_port_3_r },            /* Coin/System inputs */
  644.     { 0x280000, 0x28dfff, MRA_BANK2 },                /* part of shared ram ? */
  645. #if Zx80
  646.     { 0x28e000, 0x28fbff, shared_ram_r },            /* $21f000 status port */
  647.     { 0x28fc00, 0x28ffff, Zx80_sharedram_r },        /* 16-bit on 68000 side, 8-bit on Zx80 side */
  648. #else
  649.     { 0x28e000, 0x28efff, shared_ram_r },
  650.     { 0x28f000, 0x28f001, Zx80_status_port_r },        /* Zx80 status port */
  651.     { 0x28f002, 0x28fbff, MRA_BANK3 },                /* part of shared ram ? */
  652.     { 0x28fc00, 0x28ffff, Zx80_sharedram_r },        /* 16-bit on 68000 side, 8-bit on Zx80 side */
  653. #endif
  654.     { 0x300004, 0x300007, toaplan2_0_videoram_r },
  655.     { 0x30000c, 0x30000d, input_port_0_r },
  656.     { 0x400000, 0x400fff, paletteram_word_r },
  657.     { 0x500000, 0x501fff, MRA_BANK4 },
  658.     { 0x502000, 0x5021ff, MRA_BANK5 },
  659.     { 0x503000, 0x5031ff, MRA_BANK6 },
  660.     { 0x600000, 0x60ffff, MRA_BANK7 },
  661.     { 0x800000, 0x800001, video_status_r },
  662.     { -1 }
  663. };
  664.  
  665. static struct MemoryWriteAddress fixeight_writemem[] =
  666. {
  667.     { 0x000000, 0x07ffff, MWA_ROM },
  668.     { 0x100000, 0x103fff, MWA_BANK1 },
  669.     { 0x20001c, 0x20001d, toaplan2_coin_w },        /* Coin count/lock */
  670.     { 0x280000, 0x28dfff, MWA_BANK2 },                /* part of shared ram ? */
  671. #if Zx80
  672.     { 0x28e000, 0x28fbff, shared_ram_w, &toaplan2_shared_ram },    /* $21F000 */
  673.     { 0x28fc00, 0x28ffff, Zx80_sharedram_w, &Zx80_shared_ram },    /* 16-bit on 68000 side, 8-bit on Zx80 side */
  674. #else
  675.     { 0x28e000, 0x28efff, shared_ram_w, &toaplan2_shared_ram },
  676.     { 0x28f000, 0x28f001, Zx80_command_port_w },    /* Zx80 command port */
  677.     { 0x28f002, 0x28fbff, MWA_BANK3 },                /* part of shared ram ? */
  678.     { 0x28fc00, 0x28ffff, Zx80_sharedram_w, &Zx80_shared_ram },    /* 16-bit on 68000 side, 8-bit on Zx80 side */
  679. #endif
  680.     { 0x300000, 0x300001, toaplan2_0_voffs_w },        /* VideoRAM selector/offset */
  681.     { 0x300004, 0x300007, toaplan2_0_videoram_w },    /* Tile/Sprite VideoRAM */
  682.     { 0x300008, 0x300009, toaplan2_0_scroll_reg_select_w },
  683.     { 0x30000c, 0x30000d, toaplan2_0_scroll_reg_data_w },
  684.     { 0x400000, 0x400fff, paletteram_xBBBBBGGGGGRRRRR_word_w, &paletteram },
  685.     { 0x500000, 0x501fff, MWA_BANK4 },
  686.     { 0x502000, 0x5021ff, MWA_BANK5 },
  687.     { 0x503000, 0x5031ff, MWA_BANK6 },
  688.     { 0x600000, 0x60ffff, MWA_BANK7 },
  689.     { -1 }
  690. };
  691.  
  692. static struct MemoryReadAddress vfive_readmem[] =
  693. {
  694.     { 0x000000, 0x07ffff, MRA_ROM },
  695.     { 0x100000, 0x103fff, MRA_BANK1 },
  696. //    { 0x200000, 0x20ffff, MRA_ROM },                /* ROM is here ??? */
  697.     { 0x200010, 0x200011, input_port_1_r },            /* Player 1 controls */
  698.     { 0x200014, 0x200015, input_port_2_r },            /* Player 2 controls */
  699.     { 0x200018, 0x200019, input_port_3_r },            /* Coin/System inputs */
  700. #if Zx80
  701.     { 0x21e000, 0x21fbff, shared_ram_r },            /* $21f000 status port */
  702.     { 0x21fc00, 0x21ffff, Zx80_sharedram_r },        /* 16-bit on 68000 side, 8-bit on Zx80 side */
  703. #else
  704.     { 0x21e000, 0x21efff, shared_ram_r },
  705.     { 0x21f000, 0x21f001, Zx80_status_port_r },        /* Zx80 status port */
  706.     { 0x21f004, 0x21f005, input_port_4_r },            /* Dip Switch A */
  707.     { 0x21f006, 0x21f007, input_port_5_r },            /* Dip Switch B */
  708.     { 0x21fc00, 0x21ffff, Zx80_sharedram_r },        /* 16-bit on 68000 side, 8-bit on Zx80 side */
  709. #endif
  710.     { 0x300004, 0x300007, toaplan2_0_videoram_r },
  711.     { 0x30000c, 0x30000d, input_port_0_r },
  712.     { 0x400000, 0x400fff, paletteram_word_r },
  713.     { 0x700000, 0x700001, video_status_r },
  714.     { -1 }
  715. };
  716.  
  717. static struct MemoryWriteAddress vfive_writemem[] =
  718. {
  719.     { 0x000000, 0x07ffff, MWA_ROM },
  720.     { 0x100000, 0x103fff, MWA_BANK1 },
  721. //    { 0x200000, 0x20ffff, MWA_ROM },                /* ROM is here ??? */
  722.     { 0x20001c, 0x20001d, toaplan2_coin_w },        /* Coin count/lock */
  723. #if Zx80
  724.     { 0x21e000, 0x21fbff, shared_ram_w, &toaplan2_shared_ram },    /* $21F000 */
  725.     { 0x21fc00, 0x21ffff, Zx80_sharedram_w, &Zx80_shared_ram },    /* 16-bit on 68000 side, 8-bit on Zx80 side */
  726. #else
  727.     { 0x21e000, 0x21efff, shared_ram_w, &toaplan2_shared_ram },
  728.     { 0x21f000, 0x21f001, Zx80_command_port_w },    /* Zx80 command port */
  729.     { 0x21fc00, 0x21ffff, Zx80_sharedram_w, &Zx80_shared_ram },    /* 16-bit on 68000 side, 8-bit on Zx80 side */
  730. #endif
  731.     { 0x300000, 0x300001, toaplan2_0_voffs_w },        /* VideoRAM selector/offset */
  732.     { 0x300004, 0x300007, toaplan2_0_videoram_w },    /* Tile/Sprite VideoRAM */
  733.     { 0x300008, 0x300009, toaplan2_0_scroll_reg_select_w },
  734.     { 0x30000c, 0x30000d, toaplan2_0_scroll_reg_data_w },
  735.     { 0x400000, 0x400fff, paletteram_xBBBBBGGGGGRRRRR_word_w, &paletteram },
  736.     { -1 }
  737. };
  738.  
  739. static struct MemoryReadAddress batsugun_readmem[] =
  740. {
  741.     { 0x000000, 0x07ffff, MRA_ROM },
  742.     { 0x100000, 0x10ffff, MRA_BANK1 },
  743.     { 0x200010, 0x200011, input_port_1_r },            /* Player 1 controls */
  744.     { 0x200014, 0x200015, input_port_2_r },            /* Player 2 controls */
  745.     { 0x200018, 0x200019, input_port_3_r },            /* Coin/System inputs */
  746.     { 0x210000, 0x21bbff, MRA_BANK2 },
  747. #if Zx80
  748.     { 0x21e000, 0x21fbff, shared_ram_r },            /* $21f000 status port */
  749.     { 0x21fc00, 0x21ffff, Zx80_sharedram_r },        /* 16-bit on 68000 side, 8-bit on Zx80 side */
  750. #else
  751.     { 0x21e000, 0x21efff, shared_ram_r },
  752.     { 0x21f000, 0x21f001, Zx80_status_port_r },        /* Zx80 status port */
  753.     { 0x21f004, 0x21f005, input_port_4_r },            /* Dip Switch A */
  754.     { 0x21f006, 0x21f007, input_port_5_r },            /* Dip Switch B */
  755.     { 0x21fc00, 0x21ffff, Zx80_sharedram_r },        /* 16-bit on 68000 side, 8-bit on Zx80 side */
  756. #endif
  757.     /***** The following in 0x30000x are for video controller 2 ******/
  758.     { 0x300004, 0x300007, toaplan2_1_videoram_r },    /* tile layers */
  759.     { 0x30000c, 0x30000d, input_port_0_r },            /* VBlank */
  760.     { 0x400000, 0x400fff, paletteram_word_r },
  761.     /***** The following in 0x50000x are for video controller 1 ******/
  762.     { 0x500004, 0x500007, toaplan2_0_videoram_r },    /* tile layers 2 */
  763.     { 0x700000, 0x700001, video_status_r },            /* test bit 8 */
  764.     { -1 }
  765. };
  766.  
  767. static struct MemoryWriteAddress batsugun_writemem[] =
  768. {
  769.     { 0x000000, 0x07ffff, MWA_ROM },
  770.     { 0x100000, 0x10ffff, MWA_BANK1 },
  771.     { 0x20001c, 0x20001d, toaplan2_coin_w },        /* Coin count/lock */
  772.     { 0x210000, 0x21bbff, MWA_BANK2 },
  773. #if Zx80
  774.     { 0x21e000, 0x21fbff, shared_ram_w, &toaplan2_shared_ram },    /* $21F000 */
  775.     { 0x21fc00, 0x21ffff, Zx80_sharedram_w, &Zx80_shared_ram },    /* 16-bit on 68000 side, 8-bit on Zx80 side */
  776. #else
  777.     { 0x21e000, 0x21efff, shared_ram_w, &toaplan2_shared_ram },
  778.     { 0x21f000, 0x21f001, Zx80_command_port_w },    /* Zx80 command port */
  779.     { 0x21fc00, 0x21ffff, Zx80_sharedram_w, &Zx80_shared_ram },    /* 16-bit on 68000 side, 8-bit on Zx80 side */
  780. #endif
  781.     /***** The following in 0x30000x are for video controller 2 ******/
  782.     { 0x300000, 0x300001, toaplan2_1_voffs_w },        /* VideoRAM selector/offset */
  783.     { 0x300004, 0x300007, toaplan2_1_videoram_w },    /* Tile/Sprite VideoRAM */
  784.     { 0x300008, 0x300009, toaplan2_1_scroll_reg_select_w },
  785.     { 0x30000c, 0x30000d, toaplan2_1_scroll_reg_data_w },
  786.     { 0x400000, 0x400fff, paletteram_xBBBBBGGGGGRRRRR_word_w, &paletteram },
  787.     /***** The following in 0x50000x are for video controller 1 ******/
  788.     { 0x500000, 0x500001, toaplan2_0_voffs_w },        /* VideoRAM selector/offset */
  789.     { 0x500004, 0x500007, toaplan2_0_videoram_w },    /* Tile/Sprite VideoRAM */
  790.     { 0x500008, 0x500009, toaplan2_0_scroll_reg_select_w },
  791.     { 0x50000c, 0x50000d, toaplan2_0_scroll_reg_data_w },
  792.     { -1 }
  793. };
  794.  
  795. static struct MemoryReadAddress snowbro2_readmem[] =
  796. {
  797.     { 0x000000, 0x07ffff, MRA_ROM },
  798.     { 0x100000, 0x10ffff, MRA_BANK1 },
  799.     { 0x300004, 0x300007, toaplan2_0_videoram_r },    /* tile layers */
  800.     { 0x30000c, 0x30000d, input_port_0_r },            /* VBlank */
  801.     { 0x400000, 0x400fff, paletteram_word_r },
  802.     { 0x500002, 0x500003, YM2151_status_port_0_r },
  803.     { 0x600000, 0x600001, OKIM6295_status_0_r },
  804.     { 0x700000, 0x700001, input_port_8_r },            /* Territory Jumper block */
  805.     { 0x700004, 0x700005, input_port_6_r },            /* Dip Switch A */
  806.     { 0x700008, 0x700009, input_port_7_r },            /* Dip Switch B */
  807.     { 0x70000c, 0x70000d, input_port_1_r },            /* Player 1 controls */
  808.     { 0x700010, 0x700011, input_port_2_r },            /* Player 2 controls */
  809.     { 0x700014, 0x700015, input_port_3_r },            /* Player 3 controls */
  810.     { 0x700018, 0x700019, input_port_4_r },            /* Player 4 controls */
  811.     { 0x70001c, 0x70001d, input_port_5_r },            /* Coin/System inputs */
  812.     { -1 }
  813. };
  814.  
  815. static struct MemoryWriteAddress snowbro2_writemem[] =
  816. {
  817.     { 0x000000, 0x07ffff, MWA_ROM },
  818.     { 0x100000, 0x10ffff, MWA_BANK1 },
  819.     { 0x300000, 0x300001, toaplan2_0_voffs_w },        /* VideoRAM selector/offset */
  820.     { 0x300004, 0x300007, toaplan2_0_videoram_w },    /* Tile/Sprite VideoRAM */
  821.     { 0x300008, 0x300009, toaplan2_0_scroll_reg_select_w },
  822.     { 0x30000c, 0x30000d, toaplan2_0_scroll_reg_data_w },
  823.     { 0x400000, 0x400fff, paletteram_xBBBBBGGGGGRRRRR_word_w, &paletteram },
  824.     { 0x500000, 0x500001, YM2151_register_port_0_w },
  825.     { 0x500002, 0x500003, YM2151_data_port_0_w },
  826.     { 0x600000, 0x600001, OKIM6295_data_0_w },
  827.     { 0x700030, 0x700031, oki_bankswitch_w },        /* Sample bank switch */
  828.     { 0x700034, 0x700035, toaplan2_coin_w },        /* Coin count/lock */
  829.     { -1 }
  830. };
  831.  
  832.  
  833. static struct MemoryReadAddress sound_readmem[] =
  834. {
  835.     { 0x0000, 0x7fff, MRA_ROM },
  836.     { 0x8000, 0x87ff, MRA_RAM },
  837.     { 0xe000, 0xe000, YM3812_status_port_0_r },
  838.     { -1 }  /* end of table */
  839. };
  840.  
  841. static struct MemoryWriteAddress sound_writemem[] =
  842. {
  843.     { 0x0000, 0x7fff, MWA_ROM },
  844.     { 0x8000, 0x87ff, MWA_RAM, &toaplan2_shared_ram },
  845.     { 0xe000, 0xe000, YM3812_control_port_0_w },
  846.     { 0xe001, 0xe001, YM3812_write_port_0_w },
  847.     { -1 }  /* end of table */
  848. };
  849.  
  850.  
  851. #if HD64x180
  852. static struct MemoryReadAddress hd647180_readmem[] =
  853. {
  854.     { 0x0000, 0x7fff, MRA_ROM },
  855.     { 0xfe00, 0xffff, MRA_RAM },            /* Internal 512 bytes of RAM */
  856.     { -1 }  /* end of table */
  857. };
  858.  
  859. static struct MemoryWriteAddress hd647180_writemem[] =
  860. {
  861.     { 0x0000, 0x7fff, MWA_ROM },
  862.     { 0xfe00, 0xffff, MWA_RAM },            /* Internal 512 bytes of RAM */
  863.     { -1 }  /* end of table */
  864. };
  865. #endif
  866.  
  867.  
  868. #if Zx80
  869. static struct MemoryReadAddress Zx80_readmem[] =
  870. {
  871.     { 0x0000, 0x7fff, MRA_RAM },
  872.     { -1 }  /* end of table */
  873. };
  874.  
  875. static struct MemoryWriteAddress Zx80_writemem[] =
  876. {
  877.     { 0x0000, 0x07fff, MWA_RAM, &Zx80_sharedram },
  878.     { -1 }  /* end of table */
  879. };
  880. #endif
  881.  
  882.  
  883.  
  884. /*****************************************************************************
  885.     Input Port definitions
  886.     Service input of the TOAPLAN2_SYSTEM_INPUTS is used as a Pause type input.
  887.     If you press then release the following buttons, the following occurs:
  888.     Service & P2 start : The game will pause.
  889.     Service & P1 start : The game will continue.
  890.     Service & P1 start & P2 start : The game will play in slow motion.
  891.  
  892. *****************************************************************************/
  893.  
  894. #define  TOAPLAN2_PLAYER_INPUT( player, button3 )                                \
  895.     PORT_START                                                                     \
  896.     PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP    | IPF_8WAY | player )    \
  897.     PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN  | IPF_8WAY | player )    \
  898.     PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT  | IPF_8WAY | player )    \
  899.     PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT | IPF_8WAY | player )    \
  900.     PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_BUTTON1 | player)                        \
  901.     PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_BUTTON2 | player)                        \
  902.     PORT_BIT( 0x0040, IP_ACTIVE_HIGH, button3 )                                    \
  903.     PORT_BIT( 0xff80, IP_ACTIVE_HIGH, IPT_UNKNOWN )
  904.  
  905. #define  TOAPLAN2_SYSTEM_INPUTS                        \
  906.     PORT_START                                        \
  907.     PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_COIN3 )     \
  908.     PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_TILT )    \
  909.     PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_SERVICE1 )\
  910.     PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_COIN1 )    \
  911.     PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_COIN2 )    \
  912.     PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_START1 )    \
  913.     PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_START2 )    \
  914.     PORT_BIT( 0xff80, IP_ACTIVE_HIGH, IPT_UNKNOWN )
  915.  
  916. #define  TOAPLAN2_DSW_A                                                \
  917.     PORT_START                                                        \
  918.     PORT_DIPNAME( 0x01,    0x00, DEF_STR( Unused ) )                    \
  919.     PORT_DIPSETTING(    0x00, DEF_STR( Off ) )                        \
  920.     PORT_DIPSETTING(    0x01, DEF_STR( On ) )                        \
  921.     PORT_DIPNAME( 0x02,    0x00, DEF_STR( Flip_Screen ) )                \
  922.     PORT_DIPSETTING(    0x00, DEF_STR( Off ) )                        \
  923.     PORT_DIPSETTING(    0x02, DEF_STR( On ) )                        \
  924.     PORT_SERVICE( 0x04, IP_ACTIVE_HIGH )        /* Service Mode */    \
  925.     PORT_DIPNAME( 0x08,    0x00, DEF_STR( Demo_Sounds ) )                \
  926.     PORT_DIPSETTING(    0x08, DEF_STR( Off ) )                        \
  927.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )                        \
  928.     PORT_DIPNAME( 0x30,    0x00, DEF_STR( Coin_A ) )                    \
  929.     PORT_DIPSETTING(    0x30, DEF_STR( 4C_1C ) )                    \
  930.     PORT_DIPSETTING(    0x20, DEF_STR( 3C_1C ) )                    \
  931.     PORT_DIPSETTING(    0x10, DEF_STR( 2C_1C ) )                    \
  932.     PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )                    \
  933.     PORT_DIPNAME( 0xc0,    0x00, DEF_STR( Coin_B ) )                    \
  934.     PORT_DIPSETTING(    0x00, DEF_STR( 1C_2C ) )                    \
  935.     PORT_DIPSETTING(    0x40, DEF_STR( 1C_3C ) )                    \
  936.     PORT_DIPSETTING(    0x80, DEF_STR( 1C_4C ) )                    \
  937.     PORT_DIPSETTING(    0xc0, DEF_STR( 1C_6C ) )                    \
  938. /*    Non-European territories coin setups                            \
  939.     PORT_DIPNAME( 0x30,    0x00, DEF_STR( Coin_A ) )                    \
  940.     PORT_DIPSETTING(    0x20, DEF_STR( 2C_1C ) )                    \
  941.     PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )                    \
  942.     PORT_DIPSETTING(    0x30, DEF_STR( 2C_3C ) )                    \
  943.     PORT_DIPSETTING(    0x10, DEF_STR( 1C_2C ) )                    \
  944.     PORT_DIPNAME( 0xc0,    0x00, DEF_STR( Coin_B ) )                    \
  945.     PORT_DIPSETTING(    0x80, DEF_STR( 2C_1C ) )                    \
  946.     PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )                    \
  947.     PORT_DIPSETTING(    0xc0, DEF_STR( 2C_3C ) )                    \
  948.     PORT_DIPSETTING(    0x40, DEF_STR( 1C_2C ) )                    \
  949. */
  950.  
  951.  
  952.  
  953.  
  954. INPUT_PORTS_START( tekipaki )
  955.     PORT_START        /* (0) VBlank */
  956.     PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_VBLANK )
  957.     PORT_BIT( 0xfffe, IP_ACTIVE_HIGH, IPT_UNKNOWN )
  958.  
  959.     TOAPLAN2_PLAYER_INPUT( IPF_PLAYER1, IPT_UNKNOWN )
  960.  
  961.     TOAPLAN2_PLAYER_INPUT( IPF_PLAYER2, IPT_UNKNOWN )
  962.  
  963.     TOAPLAN2_SYSTEM_INPUTS
  964.  
  965.     TOAPLAN2_DSW_A
  966.  
  967.     PORT_START        /* (5) DSWB */
  968.     PORT_DIPNAME( 0x03,    0x00, DEF_STR( Difficulty ) )
  969.     PORT_DIPSETTING(    0x01, "Easy" )
  970.     PORT_DIPSETTING(    0x00, "Medium" )
  971.     PORT_DIPSETTING(    0x02, "Hard" )
  972.     PORT_DIPSETTING(    0x03, "Hardest" )
  973.     PORT_DIPNAME( 0x04,    0x00, DEF_STR( Unused ) )
  974.     PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
  975.     PORT_DIPSETTING(    0x04, DEF_STR( On ) )
  976.     PORT_DIPNAME( 0x08,    0x00, DEF_STR( Unused ) )
  977.     PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
  978.     PORT_DIPSETTING(    0x08, DEF_STR( On ) )
  979.     PORT_DIPNAME( 0x10,    0x00, DEF_STR( Unused ) )
  980.     PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
  981.     PORT_DIPSETTING(    0x10, DEF_STR( On ) )
  982.     PORT_DIPNAME( 0x20,    0x00, DEF_STR( Unused ) )
  983.     PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
  984.     PORT_DIPSETTING(    0x20, DEF_STR( On ) )
  985.     PORT_DIPNAME( 0x40,    0x00, "Game Mode" )
  986.     PORT_DIPSETTING(    0x00, "Normal" )
  987.     PORT_DIPSETTING(    0x40, "Stop" )
  988.     PORT_DIPNAME( 0x80,    0x00, DEF_STR( Unused ) )
  989.     PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
  990.     PORT_DIPSETTING(    0x80, DEF_STR( On ) )
  991.  
  992.     PORT_START        /* (6) Territory Jumper block */
  993.     PORT_DIPNAME( 0x0f,    0x02, "Territory" )
  994.     PORT_DIPSETTING(    0x02, "Europe" )
  995.     PORT_DIPSETTING(    0x01, "USA" )
  996.     PORT_DIPSETTING(    0x00, "Japan" )
  997.     PORT_DIPSETTING(    0x03, "Hong Kong" )
  998.     PORT_DIPSETTING(    0x05, "Taiwan" )
  999.     PORT_DIPSETTING(    0x04, "Korea" )
  1000.     PORT_DIPSETTING(    0x07, "USA (Romstar)" )
  1001.     PORT_DIPSETTING(    0x08, "Hong Kong (Honest Trading Co.)" )
  1002.     PORT_DIPSETTING(    0x06, "Taiwan (Spacy Co. Ltd)" )
  1003.     PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_UNKNOWN )
  1004. INPUT_PORTS_END
  1005.  
  1006. INPUT_PORTS_START( ghox )
  1007.     PORT_START        /* (0) VBlank */
  1008.     PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_VBLANK )
  1009.     PORT_BIT( 0xfffe, IP_ACTIVE_HIGH, IPT_UNKNOWN )
  1010.  
  1011.     TOAPLAN2_PLAYER_INPUT( IPF_PLAYER1, IPT_UNKNOWN )
  1012.  
  1013.     TOAPLAN2_PLAYER_INPUT( IPF_PLAYER2, IPT_UNKNOWN )
  1014.  
  1015.     TOAPLAN2_SYSTEM_INPUTS
  1016.  
  1017.     TOAPLAN2_DSW_A
  1018.  
  1019.     PORT_START        /* (5) DSWB */
  1020.     PORT_DIPNAME( 0x03,    0x00, DEF_STR( Difficulty ) )
  1021.     PORT_DIPSETTING(    0x01, "Easy" )
  1022.     PORT_DIPSETTING(    0x00, "Medium" )
  1023.     PORT_DIPSETTING(    0x02, "Hard" )
  1024.     PORT_DIPSETTING(    0x03, "Hardest" )
  1025.     PORT_DIPNAME( 0x0c,    0x00, DEF_STR( Bonus_Life ) )
  1026.     PORT_DIPSETTING(    0x00, "100K, every 200K" )
  1027.     PORT_DIPSETTING(    0x04, "100K, every 300K" )
  1028.     PORT_DIPSETTING(    0x08, "100K" )
  1029.     PORT_DIPSETTING(    0x0c, "None" )
  1030.     PORT_DIPNAME( 0x30,    0x00, DEF_STR( Lives ) )
  1031.     PORT_DIPSETTING(    0x30, "1" )
  1032.     PORT_DIPSETTING(    0x20, "2" )
  1033.     PORT_DIPSETTING(    0x00, "3" )
  1034.     PORT_DIPSETTING(    0x10, "5" )
  1035.     PORT_BITX(      0x40,    0x00, IPT_DIPSWITCH_NAME | IPF_CHEAT, "Invulnerability", IP_KEY_NONE, IP_JOY_NONE )
  1036.     PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
  1037.     PORT_DIPSETTING(    0x40, DEF_STR( On ) )
  1038.     PORT_DIPNAME( 0x80,    0x00, DEF_STR( Unused ) )
  1039.     PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
  1040.     PORT_DIPSETTING(    0x80, DEF_STR( On ) )
  1041.  
  1042.     PORT_START        /* (6) Territory Jumper block */
  1043.     PORT_DIPNAME( 0x0f,    0x02, "Territory" )
  1044.     PORT_DIPSETTING(    0x02, "Europe" )
  1045.     PORT_DIPSETTING(    0x01, "USA" )
  1046.     PORT_DIPSETTING(    0x00, "Japan" )
  1047.     PORT_DIPSETTING(    0x04, "Korea" )
  1048.     PORT_DIPSETTING(    0x03, "Hong Kong (Honest Trading Co." )
  1049.     PORT_DIPSETTING(    0x05, "Taiwan" )
  1050.     PORT_DIPSETTING(    0x06, "Spain & Portugal (APM Electronics SA)" )
  1051.     PORT_DIPSETTING(    0x07, "Italy (Star Electronica SRL)" )
  1052.     PORT_DIPSETTING(    0x08, "UK (JP Leisure Ltd)" )
  1053.     PORT_DIPSETTING(    0x0a, "Europe (Nova Apparate GMBH & Co)" )
  1054.     PORT_DIPSETTING(    0x0d, "Europe (Taito Corporation Japan)" )
  1055.     PORT_DIPSETTING(    0x09, "USA (Romstar)" )
  1056.     PORT_DIPSETTING(    0x0b, "USA (Taito America Corporation)" )
  1057.     PORT_DIPSETTING(    0x0c, "USA (Taito Corporation Japan)" )
  1058.     PORT_DIPSETTING(    0x0e, "Japan (Taito Corporation)" )
  1059.     PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_UNKNOWN )
  1060.  
  1061.     PORT_START        /* (7)  Paddle 1 (left-right)  read at $100000 */
  1062.     PORT_ANALOG( 0xff, 0x00, IPT_DIAL | IPF_PLAYER1, 25, 15, 0, 0xff )
  1063.  
  1064.     PORT_START        /* (8)  Paddle 2 (left-right)  read at $040000 */
  1065.     PORT_ANALOG( 0xff, 0x00, IPT_DIAL | IPF_PLAYER2, 25, 15, 0, 0xff )
  1066.  
  1067.     PORT_START        /* (9)  Paddle 1 (fake up-down) */
  1068.     PORT_ANALOG( 0xff, 0x00, IPT_DIAL_V | IPF_PLAYER1, 15, 0, 0, 0xff )
  1069.  
  1070.     PORT_START        /* (10) Paddle 2 (fake up-down) */
  1071.     PORT_ANALOG( 0xff, 0x00, IPT_DIAL_V | IPF_PLAYER2, 15, 0, 0, 0xff )
  1072. INPUT_PORTS_END
  1073.  
  1074. INPUT_PORTS_START( dogyuun )
  1075.     PORT_START        /* (0) VBlank */
  1076.     PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_VBLANK )
  1077.     PORT_BIT( 0xfffe, IP_ACTIVE_HIGH, IPT_UNKNOWN )
  1078.  
  1079.     TOAPLAN2_PLAYER_INPUT( IPF_PLAYER1, IPT_BUTTON3 | IPF_PLAYER1 )
  1080.  
  1081.     TOAPLAN2_PLAYER_INPUT( IPF_PLAYER2, IPT_BUTTON3 | IPF_PLAYER2 )
  1082.  
  1083.     TOAPLAN2_SYSTEM_INPUTS
  1084.  
  1085.     PORT_START        /* (4) DSWA */
  1086.     PORT_DIPNAME( 0x0001,    0x0000, "Play Mode" )
  1087.     PORT_DIPSETTING(        0x0000, "Coin Play" )
  1088.     PORT_DIPSETTING(        0x0001, DEF_STR( Free_Play) )
  1089.     PORT_DIPNAME( 0x0002,    0x0000, DEF_STR( Flip_Screen ) )
  1090.     PORT_DIPSETTING(        0x0000, DEF_STR( Off ) )
  1091.     PORT_DIPSETTING(        0x0002, DEF_STR( On ) )
  1092.     PORT_SERVICE( 0x0004,    IP_ACTIVE_HIGH )        /* Service Mode */
  1093.     PORT_DIPNAME( 0x0008,    0x0000, DEF_STR( Demo_Sounds ) )
  1094.     PORT_DIPSETTING(        0x0008, DEF_STR( Off ) )
  1095.     PORT_DIPSETTING(        0x0000, DEF_STR( On ) )
  1096.     PORT_DIPNAME( 0x0030,    0x0000, DEF_STR( Coin_A ) )
  1097.     PORT_DIPSETTING(        0x0020, DEF_STR( 2C_1C ) )
  1098.     PORT_DIPSETTING(        0x0000, DEF_STR( 1C_1C ) )
  1099.     PORT_DIPSETTING(        0x0030, DEF_STR( 2C_3C ) )
  1100.     PORT_DIPSETTING(        0x0010, DEF_STR( 1C_2C ) )
  1101.     PORT_DIPNAME( 0x00c0,    0x0000, DEF_STR( Coin_B ) )
  1102.     PORT_DIPSETTING(        0x0080, DEF_STR( 2C_1C ) )
  1103.     PORT_DIPSETTING(        0x0000, DEF_STR( 1C_1C ) )
  1104.     PORT_DIPSETTING(        0x00c0, DEF_STR( 2C_3C ) )
  1105.     PORT_DIPSETTING(        0x0040, DEF_STR( 1C_2C ) )
  1106.     PORT_BIT( 0xff00, IP_ACTIVE_HIGH, IPT_UNKNOWN )
  1107.  
  1108.     PORT_START        /* (5) DSWB */
  1109.     PORT_DIPNAME( 0x0003,    0x0000, DEF_STR( Difficulty ) )
  1110.     PORT_DIPSETTING(        0x0001, "Easy" )
  1111.     PORT_DIPSETTING(        0x0000, "Medium" )
  1112.     PORT_DIPSETTING(        0x0002, "Hard" )
  1113.     PORT_DIPSETTING(        0x0003, "Hardest" )
  1114.     PORT_DIPNAME( 0x000c,    0x0000, DEF_STR( Bonus_Life ) )
  1115.     PORT_DIPSETTING(        0x0000, "200K" )
  1116.     PORT_DIPSETTING(        0x0004, "200K, 400K, 600K" )
  1117.     PORT_DIPSETTING(        0x0008, "400K" )
  1118.     PORT_DIPSETTING(        0x000c, "None" )
  1119.     PORT_DIPNAME( 0x0030,    0x0000, DEF_STR( Lives ) )
  1120.     PORT_DIPSETTING(        0x0030, "1" )
  1121.     PORT_DIPSETTING(        0x0020, "2" )
  1122.     PORT_DIPSETTING(        0x0000, "3" )
  1123.     PORT_DIPSETTING(        0x0010, "5" )
  1124.     PORT_BITX(      0x0040,    0x0000, IPT_DIPSWITCH_NAME | IPF_CHEAT, "Invulnerability", IP_KEY_NONE, IP_JOY_NONE )
  1125.     PORT_DIPSETTING(        0x0000, DEF_STR( Off ) )
  1126.     PORT_DIPSETTING(        0x0040, DEF_STR( On ) )
  1127.     PORT_DIPNAME( 0x0080,    0x0000, "Allow Continue" )
  1128.     PORT_DIPSETTING(        0x0080, DEF_STR( No ) )
  1129.     PORT_DIPSETTING(        0x0000, DEF_STR( Yes ) )
  1130. INPUT_PORTS_END
  1131.  
  1132. INPUT_PORTS_START( kbash )
  1133.     PORT_START        /* (0) VBlank */
  1134.     PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_VBLANK )
  1135.     PORT_BIT( 0xfffe, IP_ACTIVE_HIGH, IPT_UNKNOWN )
  1136.  
  1137.     TOAPLAN2_PLAYER_INPUT( IPF_PLAYER1, IPT_BUTTON3 | IPF_PLAYER1 )
  1138.  
  1139.     TOAPLAN2_PLAYER_INPUT( IPF_PLAYER2, IPT_BUTTON3 | IPF_PLAYER2 )
  1140.  
  1141.     TOAPLAN2_SYSTEM_INPUTS
  1142.  
  1143.     PORT_START        /* (4) DSWA */
  1144.     PORT_DIPNAME( 0x0001,    0x0000, "Continue Mode" )
  1145.     PORT_DIPSETTING(        0x0000, "Normal" )
  1146.     PORT_DIPSETTING(        0x0001, "Discount" )
  1147.     PORT_DIPNAME( 0x0002,    0x0000, DEF_STR( Flip_Screen ) )
  1148.     PORT_DIPSETTING(        0x0000, DEF_STR( Off ) )
  1149.     PORT_DIPSETTING(        0x0002, DEF_STR( On ) )
  1150.     PORT_SERVICE( 0x0004,    IP_ACTIVE_HIGH )        /* Service Mode */
  1151.     PORT_DIPNAME( 0x0008,    0x0000, DEF_STR( Demo_Sounds ) )
  1152.     PORT_DIPSETTING(        0x0008, DEF_STR( Off ) )
  1153.     PORT_DIPSETTING(        0x0000, DEF_STR( On ) )
  1154.     PORT_DIPNAME( 0x0030,    0x0000, DEF_STR( Coin_A ) )
  1155.     PORT_DIPSETTING(        0x0030, DEF_STR( 4C_1C ) )
  1156.     PORT_DIPSETTING(        0x0020, DEF_STR( 3C_1C ) )
  1157.     PORT_DIPSETTING(        0x0010, DEF_STR( 2C_1C ) )
  1158.     PORT_DIPSETTING(        0x0000, DEF_STR( 1C_1C ) )
  1159.     PORT_DIPNAME( 0x00c0,    0x0000, DEF_STR( Coin_B ) )
  1160.     PORT_DIPSETTING(        0x0000, DEF_STR( 1C_2C ) )
  1161.     PORT_DIPSETTING(        0x0040, DEF_STR( 1C_3C ) )
  1162.     PORT_DIPSETTING(        0x0080, DEF_STR( 1C_4C ) )
  1163.     PORT_DIPSETTING(        0x00c0, DEF_STR( 1C_6C ) )
  1164.     PORT_BIT( 0xff00, IP_ACTIVE_HIGH, IPT_UNKNOWN )
  1165. /*    Non-European territories coin setup
  1166.     PORT_DIPNAME( 0x0030,    0x0000, DEF_STR( Coin_A ) )
  1167.     PORT_DIPSETTING(        0x0020, DEF_STR( 2C_1C ) )
  1168.     PORT_DIPSETTING(        0x0000, DEF_STR( 1C_1C ) )
  1169.     PORT_DIPSETTING(        0x0030, DEF_STR( 2C_3C ) )
  1170.     PORT_DIPSETTING(        0x0010, DEF_STR( 1C_2C ) )
  1171.     PORT_DIPNAME( 0x00c0,    0x0000, DEF_STR( Coin_B ) )
  1172.     PORT_DIPSETTING(        0x0080, DEF_STR( 2C_1C ) )
  1173.     PORT_DIPSETTING(        0x0000, DEF_STR( 1C_1C ) )
  1174.     PORT_DIPSETTING(        0x00c0, DEF_STR( 2C_3C ) )
  1175.     PORT_DIPSETTING(        0x0040, DEF_STR( 1C_2C ) )
  1176. */
  1177.  
  1178.     PORT_START        /* (5) DSWB */
  1179.     PORT_DIPNAME( 0x0003,    0x0000, DEF_STR( Difficulty ) )
  1180.     PORT_DIPSETTING(        0x0001, "Easy" )
  1181.     PORT_DIPSETTING(        0x0000, "Medium" )
  1182.     PORT_DIPSETTING(        0x0002, "Hard" )
  1183.     PORT_DIPSETTING(        0x0003, "Hardest" )
  1184.     PORT_DIPNAME( 0x000c,    0x0000, DEF_STR( Bonus_Life ) )
  1185.     PORT_DIPSETTING(        0x0000, "100K, every 400K" )
  1186.     PORT_DIPSETTING(        0x0004, "100K" )
  1187.     PORT_DIPSETTING(        0x0008, "200K" )
  1188.     PORT_DIPSETTING(        0x000c, "None" )
  1189.     PORT_DIPNAME( 0x0030,    0x0020, DEF_STR( Lives ) )
  1190.     PORT_DIPSETTING(        0x0030, "1" )
  1191.     PORT_DIPSETTING(        0x0000, "2" )
  1192.     PORT_DIPSETTING(        0x0020, "3" )
  1193.     PORT_DIPSETTING(        0x0010, "4" )
  1194.     PORT_BITX(      0x0040,    0x0000, IPT_DIPSWITCH_NAME | IPF_CHEAT, "Invulnerability", IP_KEY_NONE, IP_JOY_NONE )
  1195.     PORT_DIPSETTING(        0x0000, DEF_STR( Off ) )
  1196.     PORT_DIPSETTING(        0x0040, DEF_STR( On ) )
  1197.     PORT_DIPNAME( 0x0080,    0x0000, "Allow Continue" )
  1198.     PORT_DIPSETTING(        0x0080, DEF_STR( No ) )
  1199.     PORT_DIPSETTING(        0x0000, DEF_STR( Yes ) )
  1200.     PORT_BIT( 0xff00, IP_ACTIVE_HIGH, IPT_UNKNOWN )
  1201.  
  1202.     PORT_START        /* (6) Territory Jumper block */
  1203.     PORT_DIPNAME( 0x000f,    0x000a, "Territory" )
  1204.     PORT_DIPSETTING(        0x000a, "Europe" )
  1205.     PORT_DIPSETTING(        0x0009, "USA" )
  1206.     PORT_DIPSETTING(        0x0000, "Japan" )
  1207.     PORT_DIPSETTING(        0x0003, "Korea" )
  1208.     PORT_DIPSETTING(        0x0004, "Hong Kong" )
  1209.     PORT_DIPSETTING(        0x0007, "Taiwan" )
  1210.     PORT_DIPSETTING(        0x0006, "South East Asia" )
  1211.     PORT_DIPSETTING(        0x0002, "Europe, USA (Atari License)" )
  1212.     PORT_DIPSETTING(        0x0001, "USA, Europe (Atari License)" )
  1213.     PORT_BIT( 0xfff0, IP_ACTIVE_HIGH, IPT_UNKNOWN )
  1214. INPUT_PORTS_END
  1215.  
  1216. INPUT_PORTS_START( pipibibs )
  1217.     PORT_START        /* (0) VBlank */
  1218.     PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_VBLANK )
  1219.     PORT_BIT( 0xfffe, IP_ACTIVE_HIGH, IPT_UNKNOWN )
  1220.  
  1221.     TOAPLAN2_PLAYER_INPUT( IPF_PLAYER1, IPT_UNKNOWN )
  1222.  
  1223.     TOAPLAN2_PLAYER_INPUT( IPF_PLAYER2, IPT_UNKNOWN )
  1224.  
  1225.     TOAPLAN2_SYSTEM_INPUTS
  1226.  
  1227.     TOAPLAN2_DSW_A
  1228.  
  1229.     PORT_START        /* (5) DSWB */
  1230.     PORT_DIPNAME( 0x03,    0x00, DEF_STR( Difficulty ) )
  1231.     PORT_DIPSETTING(    0x01, "Easy" )
  1232.     PORT_DIPSETTING(    0x00, "Medium" )
  1233.     PORT_DIPSETTING(    0x02, "Hard" )
  1234.     PORT_DIPSETTING(    0x03, "Hardest" )
  1235.     PORT_DIPNAME( 0x0c,    0x00, DEF_STR( Bonus_Life ) )
  1236.     PORT_DIPSETTING(    0x04, "150K, every 200K" )
  1237.     PORT_DIPSETTING(    0x00, "200K, every 300K" )
  1238.     PORT_DIPSETTING(    0x08, "200K" )
  1239.     PORT_DIPSETTING(    0x0c, "None" )
  1240.     PORT_DIPNAME( 0x30,    0x00, DEF_STR( Lives ) )
  1241.     PORT_DIPSETTING(    0x30, "1" )
  1242.     PORT_DIPSETTING(    0x20, "2" )
  1243.     PORT_DIPSETTING(    0x00, "3" )
  1244.     PORT_DIPSETTING(    0x10, "5" )
  1245.     PORT_BITX(      0x40,    0x00, IPT_DIPSWITCH_NAME | IPF_CHEAT, "Invulnerability", IP_KEY_NONE, IP_JOY_NONE )
  1246.     PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
  1247.     PORT_DIPSETTING(    0x40, DEF_STR( On ) )
  1248.     PORT_DIPNAME( 0x80,    0x00, DEF_STR( Unused ) )
  1249.     PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
  1250.     PORT_DIPSETTING(    0x80, DEF_STR( On ) )
  1251.  
  1252.     PORT_START        /* (6) Territory Jumper block */
  1253.     PORT_DIPNAME( 0x07,    0x06, "Territory" )
  1254.     PORT_DIPSETTING(    0x06, "Europe" )
  1255.     PORT_DIPSETTING(    0x04, "USA" )
  1256.     PORT_DIPSETTING(    0x00, "Japan" )
  1257.     PORT_DIPSETTING(    0x02, "Hong Kong" )
  1258.     PORT_DIPSETTING(    0x03, "Taiwan" )
  1259.     PORT_DIPSETTING(    0x01, "Asia" )
  1260.     PORT_DIPSETTING(    0x07, "Europe (Nova Apparate GMBH & Co)" )
  1261.     PORT_DIPSETTING(    0x05, "USA (Romstar)" )
  1262.     PORT_BIT( 0xf8, IP_ACTIVE_HIGH, IPT_UNKNOWN )
  1263. INPUT_PORTS_END
  1264.  
  1265. INPUT_PORTS_START( whoopee )
  1266.     PORT_START        /* (0) VBlank */
  1267.     PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_VBLANK )
  1268.     PORT_BIT( 0xfffe, IP_ACTIVE_HIGH, IPT_UNKNOWN )
  1269.  
  1270.     TOAPLAN2_PLAYER_INPUT( IPF_PLAYER1, IPT_UNKNOWN )
  1271.  
  1272.     TOAPLAN2_PLAYER_INPUT( IPF_PLAYER2, IPT_UNKNOWN )
  1273.  
  1274.     TOAPLAN2_SYSTEM_INPUTS
  1275.  
  1276.     PORT_START        /* (4) DSWA */
  1277.     PORT_DIPNAME( 0x01,    0x00, DEF_STR( Unused ) )
  1278.     PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
  1279.     PORT_DIPSETTING(    0x01, DEF_STR( On ) )
  1280.     PORT_DIPNAME( 0x02,    0x00, DEF_STR( Flip_Screen ) )
  1281.     PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
  1282.     PORT_DIPSETTING(    0x02, DEF_STR( On ) )
  1283.     PORT_SERVICE( 0x04,    IP_ACTIVE_HIGH )        /* Service Mode */
  1284.     PORT_DIPNAME( 0x08,    0x00, DEF_STR( Demo_Sounds ) )
  1285.     PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
  1286.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  1287.     PORT_DIPNAME( 0x30,    0x00, DEF_STR( Coin_A ) )
  1288.     PORT_DIPSETTING(    0x20, DEF_STR( 2C_1C ) )
  1289.     PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
  1290.     PORT_DIPSETTING(    0x30, DEF_STR( 2C_3C ) )
  1291.     PORT_DIPSETTING(    0x10, DEF_STR( 1C_2C ) )
  1292.     PORT_DIPNAME( 0xc0,    0x00, DEF_STR( Coin_B ) )
  1293.     PORT_DIPSETTING(    0x80, DEF_STR( 2C_1C ) )
  1294.     PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
  1295.     PORT_DIPSETTING(    0xc0, DEF_STR( 2C_3C ) )
  1296.     PORT_DIPSETTING(    0x40, DEF_STR( 1C_2C ) )
  1297. /*    Non-European territories coin setups
  1298.     PORT_DIPNAME( 0x30,    0x00, DEF_STR( Coin_A ) )
  1299.     PORT_DIPSETTING(    0x30, DEF_STR( 4C_1C ) )
  1300.     PORT_DIPSETTING(    0x20, DEF_STR( 3C_1C ) )
  1301.     PORT_DIPSETTING(    0x10, DEF_STR( 2C_1C ) )
  1302.     PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
  1303.     PORT_DIPNAME( 0xc0,    0x00, DEF_STR( Coin_B ) )
  1304.     PORT_DIPSETTING(    0x00, DEF_STR( 1C_2C ) )
  1305.     PORT_DIPSETTING(    0x40, DEF_STR( 1C_3C ) )
  1306.     PORT_DIPSETTING(    0x80, DEF_STR( 1C_4C ) )
  1307.     PORT_DIPSETTING(    0xc0, DEF_STR( 1C_6C ) )
  1308. */
  1309.  
  1310.     PORT_START        /* (5) DSWB */
  1311.     PORT_DIPNAME( 0x03,    0x00, DEF_STR( Difficulty ) )
  1312.     PORT_DIPSETTING(    0x01, "Easy" )
  1313.     PORT_DIPSETTING(    0x00, "Medium" )
  1314.     PORT_DIPSETTING(    0x02, "Hard" )
  1315.     PORT_DIPSETTING(    0x03, "Hardest" )
  1316.     PORT_DIPNAME( 0x0c,    0x00, DEF_STR( Bonus_Life ) )
  1317.     PORT_DIPSETTING(    0x04, "150K, every 200K" )
  1318.     PORT_DIPSETTING(    0x00, "200K, every 300K" )
  1319.     PORT_DIPSETTING(    0x08, "200K" )
  1320.     PORT_DIPSETTING(    0x0c, "None" )
  1321.     PORT_DIPNAME( 0x30,    0x00, DEF_STR( Lives ) )
  1322.     PORT_DIPSETTING(    0x30, "1" )
  1323.     PORT_DIPSETTING(    0x20, "2" )
  1324.     PORT_DIPSETTING(    0x00, "3" )
  1325.     PORT_DIPSETTING(    0x10, "5" )
  1326.     PORT_BITX(      0x40,    0x00, IPT_DIPSWITCH_NAME | IPF_CHEAT, "Invulnerability", IP_KEY_NONE, IP_JOY_NONE )
  1327.     PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
  1328.     PORT_DIPSETTING(    0x40, DEF_STR( On ) )
  1329.     PORT_DIPNAME( 0x80,    0x00, DEF_STR( Unused ) )
  1330.     PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
  1331.     PORT_DIPSETTING(    0x80, DEF_STR( On ) )
  1332.  
  1333.     PORT_START        /* (6) Territory Jumper block */
  1334.     PORT_DIPNAME( 0x07,    0x00, "Territory" )
  1335.     PORT_DIPSETTING(    0x06, "Europe" )
  1336.     PORT_DIPSETTING(    0x04, "USA" )
  1337.     PORT_DIPSETTING(    0x00, "Japan" )
  1338.     PORT_DIPSETTING(    0x02, "Hong Kong" )
  1339.     PORT_DIPSETTING(    0x03, "Taiwan" )
  1340.     PORT_DIPSETTING(    0x01, "Asia" )
  1341.     PORT_DIPSETTING(    0x07, "Europe (Nova Apparate GMBH & Co)" )
  1342.     PORT_DIPSETTING(    0x05, "USA (Romstar)" )
  1343.     PORT_BIT( 0xf8, IP_ACTIVE_HIGH, IPT_UNKNOWN )    /* bit 0x10 sound ready */
  1344. INPUT_PORTS_END
  1345.  
  1346. INPUT_PORTS_START( vfive )
  1347.     PORT_START        /* (0) VBlank */
  1348.     PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_VBLANK )
  1349.     PORT_BIT( 0xfffe, IP_ACTIVE_HIGH, IPT_UNKNOWN )
  1350.  
  1351.     TOAPLAN2_PLAYER_INPUT( IPF_PLAYER1, IPT_UNKNOWN )
  1352.  
  1353.     TOAPLAN2_PLAYER_INPUT( IPF_PLAYER2, IPT_UNKNOWN )
  1354.  
  1355.     TOAPLAN2_SYSTEM_INPUTS
  1356.  
  1357.     PORT_START        /* (4) DSWA */
  1358.     PORT_DIPNAME( 0x0001,    0x0000, DEF_STR( Cabinet ) )
  1359.     PORT_DIPSETTING(        0x0000, DEF_STR( Upright ) )
  1360.     PORT_DIPSETTING(        0x0001, DEF_STR( Cocktail ) )
  1361.     PORT_DIPNAME( 0x0002,    0x0000, DEF_STR( Flip_Screen ) )
  1362.     PORT_DIPSETTING(        0x0000, DEF_STR( Off ) )
  1363.     PORT_DIPSETTING(        0x0002, DEF_STR( On ) )
  1364.     PORT_SERVICE( 0x0004,    IP_ACTIVE_HIGH )        /* Service Mode */
  1365.     PORT_DIPNAME( 0x0008,    0x0000, DEF_STR( Demo_Sounds ) )
  1366.     PORT_DIPSETTING(        0x0008, DEF_STR( Off ) )
  1367.     PORT_DIPSETTING(        0x0000, DEF_STR( On ) )
  1368.     PORT_DIPNAME( 0x0030,    0x0000, DEF_STR( Coin_A ) )
  1369.     PORT_DIPSETTING(        0x0020, DEF_STR( 2C_1C ) )
  1370.     PORT_DIPSETTING(        0x0000, DEF_STR( 1C_1C ) )
  1371.     PORT_DIPSETTING(        0x0030, DEF_STR( 2C_3C ) )
  1372.     PORT_DIPSETTING(        0x0010, DEF_STR( 1C_2C ) )
  1373.     PORT_DIPNAME( 0x00c0,    0x0000, DEF_STR( Coin_B ) )
  1374.     PORT_DIPSETTING(        0x0080, DEF_STR( 2C_1C ) )
  1375.     PORT_DIPSETTING(        0x0000, DEF_STR( 1C_1C ) )
  1376.     PORT_DIPSETTING(        0x00c0, DEF_STR( 2C_3C ) )
  1377.     PORT_DIPSETTING(        0x0040, DEF_STR( 1C_2C ) )
  1378.     PORT_BIT( 0xff00, IP_ACTIVE_HIGH, IPT_UNKNOWN )
  1379.  
  1380.     PORT_START        /* (5) DSWB */
  1381.     PORT_DIPNAME( 0x0003,    0x0000, DEF_STR( Difficulty ) )
  1382.     PORT_DIPSETTING(        0x0001, "Easy" )
  1383.     PORT_DIPSETTING(        0x0000, "Medium" )
  1384.     PORT_DIPSETTING(        0x0002, "Hard" )
  1385.     PORT_DIPSETTING(        0x0003, "Hardest" )
  1386.     PORT_DIPNAME( 0x000c,    0x0000, DEF_STR( Bonus_Life ) )
  1387.     PORT_DIPSETTING(        0x0000, "300K, and 800K" )
  1388.     PORT_DIPSETTING(        0x0004, "300K, then every 800K" )
  1389.     PORT_DIPSETTING(        0x0008, "200K" )
  1390.     PORT_DIPSETTING(        0x000c, "None" )
  1391.     PORT_DIPNAME( 0x0030,    0x0000, DEF_STR( Lives ) )
  1392.     PORT_DIPSETTING(        0x0030, "1" )
  1393.     PORT_DIPSETTING(        0x0020, "2" )
  1394.     PORT_DIPSETTING(        0x0000, "3" )
  1395.     PORT_DIPSETTING(        0x0010, "5" )
  1396.     PORT_BITX(      0x0040,    0x0000, IPT_DIPSWITCH_NAME | IPF_CHEAT, "Invulnerability", IP_KEY_NONE, IP_JOY_NONE )
  1397.     PORT_DIPSETTING(        0x0000, DEF_STR( Off ) )
  1398.     PORT_DIPSETTING(        0x0040, DEF_STR( On ) )
  1399.     PORT_DIPNAME( 0x0080,    0x0000, "Allow Continue" )
  1400.     PORT_DIPSETTING(        0x0080, DEF_STR( No ) )
  1401.     PORT_DIPSETTING(        0x0000, DEF_STR( Yes ) )
  1402. INPUT_PORTS_END
  1403.  
  1404. INPUT_PORTS_START( batsugun )
  1405.     PORT_START        /* (0) VBlank */
  1406.     PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_VBLANK )
  1407.     PORT_BIT( 0xfffe, IP_ACTIVE_HIGH, IPT_UNKNOWN )
  1408.  
  1409.     TOAPLAN2_PLAYER_INPUT( IPF_PLAYER1, IPT_UNKNOWN )
  1410.  
  1411.     TOAPLAN2_PLAYER_INPUT( IPF_PLAYER2, IPT_UNKNOWN )
  1412.  
  1413.     TOAPLAN2_SYSTEM_INPUTS
  1414.  
  1415.     PORT_START        /* (4) DSWA */
  1416.     PORT_DIPNAME( 0x0001,    0x0000, "Continue Mode" )
  1417.     PORT_DIPSETTING(        0x0000, "Normal" )
  1418.     PORT_DIPSETTING(        0x0001, "Discount" )
  1419.     PORT_DIPNAME( 0x0002,    0x0000, DEF_STR( Flip_Screen ) )
  1420.     PORT_DIPSETTING(        0x0000, DEF_STR( Off ) )
  1421.     PORT_DIPSETTING(        0x0002, DEF_STR( On ) )
  1422.     PORT_SERVICE( 0x0004,    IP_ACTIVE_HIGH )        /* Service Mode */
  1423.     PORT_DIPNAME( 0x0008,    0x0000, DEF_STR( Demo_Sounds ) )
  1424.     PORT_DIPSETTING(        0x0008, DEF_STR( Off ) )
  1425.     PORT_DIPSETTING(        0x0000, DEF_STR( On ) )
  1426.     PORT_DIPNAME( 0x0030,    0x0000, DEF_STR( Coin_A ) )
  1427.     PORT_DIPSETTING(        0x0020, DEF_STR( 2C_1C ) )
  1428.     PORT_DIPSETTING(        0x0000, DEF_STR( 1C_1C ) )
  1429.     PORT_DIPSETTING(        0x0030, DEF_STR( 2C_3C ) )
  1430.     PORT_DIPSETTING(        0x0010, DEF_STR( 1C_2C ) )
  1431.     PORT_DIPNAME( 0x00c0,    0x0000, DEF_STR( Coin_B ) )
  1432.     PORT_DIPSETTING(        0x0080, DEF_STR( 2C_1C ) )
  1433.     PORT_DIPSETTING(        0x0000, DEF_STR( 1C_1C ) )
  1434.     PORT_DIPSETTING(        0x00c0, DEF_STR( 2C_3C ) )
  1435.     PORT_DIPSETTING(        0x0040, DEF_STR( 1C_2C ) )
  1436.     PORT_BIT( 0xff00, IP_ACTIVE_HIGH, IPT_UNKNOWN )
  1437.  
  1438.     PORT_START        /* (5) DSWB */
  1439.     PORT_DIPNAME( 0x0003,    0x0000, DEF_STR( Difficulty ) )
  1440.     PORT_DIPSETTING(        0x0001, "Easy" )
  1441.     PORT_DIPSETTING(        0x0000, "Medium" )
  1442.     PORT_DIPSETTING(        0x0002, "Hard" )
  1443.     PORT_DIPSETTING(        0x0003, "Hardest" )
  1444.     PORT_DIPNAME( 0x000c,    0x0000, DEF_STR( Bonus_Life ) )
  1445.     PORT_DIPSETTING(        0x0000, "1 Million" )
  1446.     PORT_DIPSETTING(        0x0004, "500K, then every 600K" )
  1447.     PORT_DIPSETTING(        0x0008, "1.5 Million" )
  1448.     PORT_DIPSETTING(        0x000c, "None" )
  1449.     PORT_DIPNAME( 0x0030,    0x0000, DEF_STR( Lives ) )
  1450.     PORT_DIPSETTING(        0x0030, "1" )
  1451.     PORT_DIPSETTING(        0x0020, "2" )
  1452.     PORT_DIPSETTING(        0x0000, "3" )
  1453.     PORT_DIPSETTING(        0x0010, "5" )
  1454.     PORT_BITX(      0x0040,    0x0000, IPT_DIPSWITCH_NAME | IPF_CHEAT, "Invulnerability", IP_KEY_NONE, IP_JOY_NONE )
  1455.     PORT_DIPSETTING(        0x0000, DEF_STR( Off ) )
  1456.     PORT_DIPSETTING(        0x0040, DEF_STR( On ) )
  1457.     PORT_DIPNAME( 0x0080,    0x0000, "Allow Continue" )
  1458.     PORT_DIPSETTING(        0x0080, DEF_STR( No ) )
  1459.     PORT_DIPSETTING(        0x0000, DEF_STR( Yes ) )
  1460. INPUT_PORTS_END
  1461.  
  1462. INPUT_PORTS_START( snowbro2 )
  1463.     PORT_START        /* (0) VBlank */
  1464.     PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_VBLANK )
  1465.     PORT_BIT( 0xfffe, IP_ACTIVE_HIGH, IPT_UNKNOWN )
  1466.  
  1467.     TOAPLAN2_PLAYER_INPUT( IPF_PLAYER1, IPT_UNKNOWN )
  1468.  
  1469.     TOAPLAN2_PLAYER_INPUT( IPF_PLAYER2, IPT_UNKNOWN )
  1470.  
  1471.     TOAPLAN2_PLAYER_INPUT( IPF_PLAYER3, IPT_START3 )
  1472.  
  1473.     TOAPLAN2_PLAYER_INPUT( IPF_PLAYER4, IPT_START4 )
  1474.  
  1475.     TOAPLAN2_SYSTEM_INPUTS
  1476.  
  1477.     PORT_START        /* (6) DSWA */
  1478.     PORT_DIPNAME( 0x0001,    0x0000, "Continue Mode" )
  1479.     PORT_DIPSETTING(        0x0000, "Normal" )
  1480.     PORT_DIPSETTING(        0x0001, "Discount" )
  1481.     PORT_DIPNAME( 0x0002,    0x0000, DEF_STR( Flip_Screen ) )
  1482.     PORT_DIPSETTING(        0x0000, DEF_STR( Off ) )
  1483.     PORT_DIPSETTING(        0x0002, DEF_STR( On ) )
  1484.     PORT_SERVICE( 0x0004,    IP_ACTIVE_HIGH )        /* Service Mode */
  1485.     PORT_DIPNAME( 0x0008,    0x0000, DEF_STR( Demo_Sounds ) )
  1486.     PORT_DIPSETTING(        0x0008, DEF_STR( Off ) )
  1487.     PORT_DIPSETTING(        0x0000, DEF_STR( On ) )
  1488.     PORT_DIPNAME( 0x0030,    0x0000, DEF_STR( Coin_A ) )
  1489.     PORT_DIPSETTING(        0x0030, DEF_STR( 4C_1C ) )
  1490.     PORT_DIPSETTING(        0x0020, DEF_STR( 3C_1C ) )
  1491.     PORT_DIPSETTING(        0x0010, DEF_STR( 2C_1C ) )
  1492.     PORT_DIPSETTING(        0x0000, DEF_STR( 1C_1C ) )
  1493.     PORT_DIPNAME( 0x00c0,    0x0000, DEF_STR( Coin_B ) )
  1494.     PORT_DIPSETTING(        0x0000, DEF_STR( 1C_2C ) )
  1495.     PORT_DIPSETTING(        0x0040, DEF_STR( 1C_3C ) )
  1496.     PORT_DIPSETTING(        0x0080, DEF_STR( 1C_4C ) )
  1497.     PORT_DIPSETTING(        0x00c0, DEF_STR( 1C_6C ) )
  1498.     PORT_BIT( 0xff00, IP_ACTIVE_HIGH, IPT_UNKNOWN )
  1499. /*    Non-European territories coin setups
  1500.     PORT_DIPNAME( 0x0030,    0x0000, DEF_STR( Coin_A ) )
  1501.     PORT_DIPSETTING(        0x0020, DEF_STR( 2C_1C ) )
  1502.     PORT_DIPSETTING(        0x0000, DEF_STR( 1C_1C ) )
  1503.     PORT_DIPSETTING(        0x0030, DEF_STR( 2C_3C ) )
  1504.     PORT_DIPSETTING(        0x0010, DEF_STR( 1C_2C ) )
  1505.     PORT_DIPNAME( 0x00c0,    0x0000, DEF_STR( Coin_B ) )
  1506.     PORT_DIPSETTING(        0x0080, DEF_STR( 2C_1C ) )
  1507.     PORT_DIPSETTING(        0x0000, DEF_STR( 1C_1C ) )
  1508.     PORT_DIPSETTING(        0x00c0, DEF_STR( 2C_3C ) )
  1509.     PORT_DIPSETTING(        0x0040, DEF_STR( 1C_2C ) )
  1510. */
  1511.  
  1512.     PORT_START        /* (7) DSWB */
  1513.     PORT_DIPNAME( 0x0003,    0x0000, DEF_STR( Difficulty ) )
  1514.     PORT_DIPSETTING(        0x0001, "Easy" )
  1515.     PORT_DIPSETTING(        0x0000, "Medium" )
  1516.     PORT_DIPSETTING(        0x0002, "Hard" )
  1517.     PORT_DIPSETTING(        0x0003, "Hardest" )
  1518.     PORT_DIPNAME( 0x000c,    0x0000, DEF_STR( Bonus_Life ) )
  1519.     PORT_DIPSETTING(        0x0004, "100K, every 500K" )
  1520.     PORT_DIPSETTING(        0x0000, "100K" )
  1521.     PORT_DIPSETTING(        0x0008, "200K" )
  1522.     PORT_DIPSETTING(        0x000c, "None" )
  1523.     PORT_DIPNAME( 0x0030,    0x0000, DEF_STR( Lives ) )
  1524.     PORT_DIPSETTING(        0x0030, "1" )
  1525.     PORT_DIPSETTING(        0x0020, "2" )
  1526.     PORT_DIPSETTING(        0x0000, "3" )
  1527.     PORT_DIPSETTING(        0x0010, "4" )
  1528.     PORT_BITX(      0x0040,    0x0000, IPT_DIPSWITCH_NAME | IPF_CHEAT, "Invulnerability", IP_KEY_NONE, IP_JOY_NONE )
  1529.     PORT_DIPSETTING(        0x0000, DEF_STR( Off ) )
  1530.     PORT_DIPSETTING(        0x0040, DEF_STR( On ) )
  1531.     PORT_DIPNAME( 0x0080,    0x0000, "Maximum Players" )
  1532.     PORT_DIPSETTING(        0x0080, "2" )
  1533.     PORT_DIPSETTING(        0x0000, "4" )
  1534.     PORT_BIT( 0xff00, IP_ACTIVE_HIGH, IPT_UNKNOWN )
  1535.  
  1536.     PORT_START        /* (8) Territory Jumper block */
  1537.     PORT_DIPNAME( 0x1c00,    0x0800, "Territory" )
  1538.     PORT_DIPSETTING(        0x0800, "Europe" )
  1539.     PORT_DIPSETTING(        0x0400, "USA" )
  1540.     PORT_DIPSETTING(        0x0000, "Japan" )
  1541.     PORT_DIPSETTING(        0x0c00, "Korea" )
  1542.     PORT_DIPSETTING(        0x1000, "Hong Kong" )
  1543.     PORT_DIPSETTING(        0x1400, "Taiwan" )
  1544.     PORT_DIPSETTING(        0x1800, "South East Asia" )
  1545.     PORT_DIPSETTING(        0x1c00, DEF_STR( Unused ) )
  1546.     PORT_DIPNAME( 0x2000,    0x0000, "Show All Rights Reserved" )
  1547.     PORT_DIPSETTING(        0x0000, DEF_STR( No ) )
  1548.     PORT_DIPSETTING(        0x2000, DEF_STR( Yes ) )
  1549.     PORT_BIT( 0xc3ff, IP_ACTIVE_HIGH, IPT_UNKNOWN )
  1550. INPUT_PORTS_END
  1551.  
  1552.  
  1553.  
  1554. static struct GfxLayout tilelayout =
  1555. {
  1556.     16,16,    /* 16x16 */
  1557.     RGN_FRAC(1,2),    /* Number of tiles */
  1558.     4,        /* 4 bits per pixel */
  1559.     { RGN_FRAC(1,2)+8, RGN_FRAC(1,2), 8, 0 },
  1560.     { 0, 1, 2, 3, 4, 5, 6, 7,
  1561.         8*16+0, 8*16+1, 8*16+2, 8*16+3, 8*16+4, 8*16+5, 8*16+6, 8*16+7 },
  1562.     { 0*16, 1*16, 2*16, 3*16, 4*16, 5*16, 6*16, 7*16,
  1563.         16*16, 17*16, 18*16, 19*16, 20*16, 21*16, 22*16, 23*16 },
  1564.     8*4*16
  1565. };
  1566.  
  1567. static struct GfxLayout spritelayout =
  1568. {
  1569.     8,8,    /* 8x8 */
  1570.     RGN_FRAC(1,2),    /* Number of 8x8 sprites */
  1571.     4,        /* 4 bits per pixel */
  1572.     { RGN_FRAC(1,2)+8, RGN_FRAC(1,2), 8, 0 },
  1573.     { 0, 1, 2, 3, 4, 5, 6, 7 },
  1574.     { 0*16, 1*16, 2*16, 3*16, 4*16, 5*16, 6*16, 7*16 },
  1575.     8*16
  1576. };
  1577.  
  1578.  
  1579. static struct GfxDecodeInfo gfxdecodeinfo[] =
  1580. {
  1581.     { REGION_GFX1, 0, &tilelayout,   0, 128 },
  1582.     { REGION_GFX1, 0, &spritelayout, 0,  64 },
  1583.     { -1 } /* end of array */
  1584. };
  1585.  
  1586. static struct GfxDecodeInfo gfxdecodeinfo_2[] =
  1587. {
  1588.     { REGION_GFX1, 0, &tilelayout,   0, 128 },
  1589.     { REGION_GFX1, 0, &spritelayout, 0,  64 },
  1590.     { REGION_GFX2, 0, &tilelayout,   0, 128 },
  1591.     { REGION_GFX2, 0, &spritelayout, 0,  64 },
  1592.     { -1 } /* end of array */
  1593. };
  1594.  
  1595.  
  1596.  
  1597. static void irqhandler(int linestate)
  1598. {
  1599.     cpu_set_irq_line(1,0,linestate);
  1600. }
  1601.  
  1602. static struct YM3812interface ym3812_interface =
  1603. {
  1604.     1,                /* 1 chip  */
  1605.     3500000,        /* 3.5 MHz */
  1606.     { 100 },        /* volume */
  1607.     { irqhandler },
  1608. };
  1609.  
  1610. static struct YM2151interface ym2151_interface =
  1611. {
  1612.     1,            /* 1 chip */
  1613.     3579545,    /* 3.58 MHZ ? */
  1614.     { YM3012_VOL(45,MIXER_PAN_LEFT,45,MIXER_PAN_RIGHT) },
  1615.     { 0 }
  1616. };
  1617.  
  1618. static struct OKIM6295interface okim6295_interface =
  1619. {
  1620.     1,                /* 1 chip */
  1621.     { 22050 },        /* frequency (Hz) */
  1622.     { 2 },            /* memory region */
  1623.     { 47 }
  1624. };
  1625.  
  1626. static struct MachineDriver machine_driver_tekipaki =
  1627. {
  1628.     /* basic machine hardware */
  1629.     {
  1630.         {
  1631.             CPU_M68000,
  1632.             10000000,
  1633.             tekipaki_readmem,tekipaki_writemem,0,0,
  1634.             toaplan2_interrupt,1
  1635.         },
  1636. #if HD64x180
  1637.         {
  1638.             CPU_Z80,            /* HD647180 CPU actually */
  1639.             27000000/8,            /* 3.37Mh ??? */
  1640.             hd647180_readmem,hd647180_writemem,0,0,
  1641.             ignore_interrupt,0
  1642.         }
  1643. #endif
  1644.     },
  1645.     60, DEFAULT_REAL_60HZ_VBLANK_DURATION,    /* frames per second, vblank duration */
  1646.     1,
  1647.     init_toaplan2,
  1648.  
  1649.     /* video hardware */
  1650.     32*16, 32*16, { 0, 319, 0, 239 },
  1651.     gfxdecodeinfo,
  1652.     (64*16)+(64*16), (64*16)+(64*16),
  1653.     0,
  1654.  
  1655.     VIDEO_TYPE_RASTER | VIDEO_MODIFIES_PALETTE | VIDEO_UPDATE_BEFORE_VBLANK, /* Sprites are buffered too */
  1656.     toaplan2_0_eof_callback,
  1657.     toaplan2_0_vh_start,
  1658.     toaplan2_0_vh_stop,
  1659.     toaplan2_0_vh_screenrefresh,
  1660.  
  1661.     /* sound hardware */
  1662.     0,0,0,0,
  1663.     {
  1664.         {
  1665.             SOUND_YM3812,
  1666.             &ym3812_interface
  1667.         },
  1668.     }
  1669. };
  1670.  
  1671. static struct MachineDriver machine_driver_ghox =
  1672. {
  1673.     /* basic machine hardware */
  1674.     {
  1675.         {
  1676.             CPU_M68000,
  1677.             10000000,
  1678.             ghox_readmem,ghox_writemem,0,0,
  1679.             toaplan2_interrupt,1
  1680.         },
  1681. #if HD64x180
  1682.         {
  1683.             CPU_Z80,            /* HD647180 CPU actually */
  1684.             27000000/8,            /* 3.37Mh ??? */
  1685.             hd647180_readmem,hd647180_writemem,0,0,
  1686.             ignore_interrupt,0
  1687.         }
  1688. #endif
  1689.     },
  1690.     60, DEFAULT_REAL_60HZ_VBLANK_DURATION,    /* frames per second, vblank duration */
  1691.     1,
  1692.     init_toaplan2,
  1693.  
  1694.     /* video hardware */
  1695.     32*16, 32*16, { 0, 319, 0, 239 },
  1696.     gfxdecodeinfo,
  1697.     (64*16)+(64*16), (64*16)+(64*16),
  1698.     0,
  1699.  
  1700.     VIDEO_TYPE_RASTER | VIDEO_MODIFIES_PALETTE | VIDEO_UPDATE_BEFORE_VBLANK, /* Sprites are buffered too */
  1701.     toaplan2_0_eof_callback,
  1702.     toaplan2_0_vh_start,
  1703.     toaplan2_0_vh_stop,
  1704.     toaplan2_0_vh_screenrefresh,
  1705.  
  1706.     /* sound hardware */
  1707.     SOUND_SUPPORTS_STEREO,0,0,0,
  1708.     {
  1709.         {
  1710.             SOUND_YM2151,
  1711.             &ym2151_interface
  1712.         }
  1713.     }
  1714. };
  1715.  
  1716. static struct MachineDriver machine_driver_dogyuun =
  1717. {
  1718.     /* basic machine hardware */
  1719.     {
  1720.         {
  1721.             CPU_M68000,
  1722.             16000000,
  1723.             dogyuun_readmem,dogyuun_writemem,0,0,
  1724.             toaplan2_interrupt,1
  1725.         },
  1726. #if Zx80
  1727.         {
  1728.             CPU_Z80,            /* Z?80 type Toaplan marked CPU ??? */
  1729.             3500000,
  1730.             Zx80_readmem,Zx80_writemem,0,0,
  1731.             ignore_interrupt,0
  1732.         }
  1733. #endif
  1734.     },
  1735.     60, DEFAULT_REAL_60HZ_VBLANK_DURATION,    /* frames per second, vblank duration */
  1736.     1,
  1737.     init_toaplan3,
  1738.  
  1739.     /* video hardware */
  1740.     32*16, 32*16, { 0, 319, 0, 239 },
  1741.     gfxdecodeinfo_2,
  1742.     (64*16)+(64*16), (64*16)+(64*16),
  1743.     0,
  1744.  
  1745.     VIDEO_TYPE_RASTER | VIDEO_MODIFIES_PALETTE | VIDEO_UPDATE_BEFORE_VBLANK, /* Sprites are buffered too */
  1746.     toaplan2_1_eof_callback,
  1747.     toaplan2_1_vh_start,
  1748.     toaplan2_1_vh_stop,
  1749.     toaplan2_1_vh_screenrefresh,
  1750.  
  1751.     /* sound hardware */
  1752.     SOUND_SUPPORTS_STEREO,0,0,0,
  1753.     {
  1754.         {
  1755.             SOUND_YM2151,
  1756.             &ym2151_interface
  1757.         },
  1758.         {
  1759.             SOUND_OKIM6295,
  1760.             &okim6295_interface
  1761.         }
  1762.     }
  1763. };
  1764.  
  1765. static struct MachineDriver machine_driver_kbash =
  1766. {
  1767.     /* basic machine hardware */
  1768.     {
  1769.         {
  1770.             CPU_M68000,
  1771.             16000000,
  1772.             kbash_readmem,kbash_writemem,0,0,
  1773.             toaplan2_interrupt,1
  1774.         },
  1775. #if Zx80
  1776.         {
  1777.             CPU_Z80,            /* Z?80 type Toaplan marked CPU ??? */
  1778.             3500000,
  1779.             Zx80_readmem,Zx80_writemem,0,0,
  1780.             ignore_interrupt,0
  1781.         }
  1782. #endif
  1783.     },
  1784.     60, DEFAULT_REAL_60HZ_VBLANK_DURATION,    /* frames per second, vblank duration */
  1785.     1,
  1786.     init_toaplan2,
  1787.  
  1788.     /* video hardware */
  1789.     32*16, 32*16, { 0, 319, 0, 239 },
  1790.     gfxdecodeinfo,
  1791.     (64*16)+(64*16), (64*16)+(64*16),
  1792.     0,
  1793.  
  1794.     VIDEO_TYPE_RASTER | VIDEO_MODIFIES_PALETTE | VIDEO_UPDATE_BEFORE_VBLANK, /* Sprites are buffered too */
  1795.     toaplan2_0_eof_callback,
  1796.     toaplan2_0_vh_start,
  1797.     toaplan2_0_vh_stop,
  1798.     toaplan2_0_vh_screenrefresh,
  1799.  
  1800.     /* sound hardware */
  1801.     SOUND_SUPPORTS_STEREO,0,0,0,
  1802.     {
  1803.         {
  1804.             SOUND_YM2151,
  1805.             &ym2151_interface
  1806.         },
  1807.         {
  1808.             SOUND_OKIM6295,
  1809.             &okim6295_interface
  1810.         }
  1811.     }
  1812. };
  1813.  
  1814. static struct MachineDriver machine_driver_tatsujn2 =
  1815. {
  1816.     /* basic machine hardware */
  1817.     {
  1818.         {
  1819.             CPU_M68000,
  1820.             16000000,
  1821.             tatsujn2_readmem,tatsujn2_writemem,0,0,
  1822.             toaplan2_interrupt,1
  1823.         },
  1824. #if Zx80
  1825.         {
  1826.             CPU_Z80,            /* Z?80 type Toaplan marked CPU ??? */
  1827.             3500000,
  1828.             Zx80_readmem,Zx80_writemem,0,0,
  1829.             ignore_interrupt,0
  1830.         }
  1831. #endif
  1832.     },
  1833.     60, DEFAULT_REAL_60HZ_VBLANK_DURATION,    /* frames per second, vblank duration */
  1834.     1,
  1835.     init_toaplan3,
  1836.  
  1837.     /* video hardware */
  1838.     32*16, 32*16, { 0, 319, 0, 239 },
  1839.     gfxdecodeinfo,
  1840.     (64*16)+(64*16), (64*16)+(64*16),
  1841.     0,
  1842.  
  1843.     VIDEO_TYPE_RASTER | VIDEO_MODIFIES_PALETTE | VIDEO_UPDATE_BEFORE_VBLANK, /* Sprites are buffered too */
  1844.     toaplan2_0_eof_callback,
  1845.     toaplan2_0_vh_start,
  1846.     toaplan2_0_vh_stop,
  1847.     toaplan2_0_vh_screenrefresh,
  1848.  
  1849.     /* sound hardware */
  1850.     SOUND_SUPPORTS_STEREO,0,0,0,
  1851.     {
  1852.         {
  1853.             SOUND_YM2151,
  1854.             &ym2151_interface
  1855.         },
  1856.         {
  1857.             SOUND_OKIM6295,
  1858.             &okim6295_interface
  1859.         }
  1860.     }
  1861. };
  1862.  
  1863. static struct MachineDriver machine_driver_pipibibs =
  1864. {
  1865.     /* basic machine hardware */
  1866.     {
  1867.         {
  1868.             CPU_M68000,
  1869.             10000000,
  1870.             pipibibs_readmem,pipibibs_writemem,0,0,
  1871.             toaplan2_interrupt,1
  1872.         },
  1873.         {
  1874.             CPU_Z80,
  1875.             3500000,
  1876.             sound_readmem,sound_writemem,0,0,
  1877.             ignore_interrupt,0
  1878.         }
  1879.     },
  1880.     60, DEFAULT_REAL_60HZ_VBLANK_DURATION,    /* frames per second, vblank duration */
  1881.     10,
  1882.     init_pipibibs,
  1883.  
  1884.     /* video hardware */
  1885.     32*16, 32*16, { 0, 319, 0, 239 },
  1886.     gfxdecodeinfo,
  1887.     (128*16), (128*16),
  1888.     0,
  1889.  
  1890.     VIDEO_TYPE_RASTER | VIDEO_MODIFIES_PALETTE | VIDEO_UPDATE_BEFORE_VBLANK, /* Sprites are buffered too */
  1891.     toaplan2_0_eof_callback,
  1892.     toaplan2_0_vh_start,
  1893.     toaplan2_0_vh_stop,
  1894.     toaplan2_0_vh_screenrefresh,
  1895.  
  1896.     /* sound hardware */
  1897.     0,0,0,0,
  1898.     {
  1899.         {
  1900.             SOUND_YM3812,
  1901.             &ym3812_interface
  1902.         },
  1903.     }
  1904. };
  1905.  
  1906. static struct MachineDriver machine_driver_whoopee =
  1907. {
  1908.     /* basic machine hardware */
  1909.     {
  1910.         {
  1911.             CPU_M68000,
  1912.             10000000,        /* ??? */
  1913.             tekipaki_readmem,tekipaki_writemem,0,0,
  1914.             toaplan2_interrupt,1
  1915.         },
  1916.         {
  1917.             CPU_Z80,        /* This should probably be a HD647180 */
  1918.             3500000,        /* ??? */
  1919.             sound_readmem,sound_writemem,0,0,
  1920.             ignore_interrupt,0
  1921.         }
  1922.     },
  1923.     60, DEFAULT_REAL_60HZ_VBLANK_DURATION,    /* frames per second, vblank duration */
  1924.     10,
  1925.     init_pipibibs,
  1926.  
  1927.     /* video hardware */
  1928.     32*16, 32*16, { 0, 319, 0, 239 },
  1929.     gfxdecodeinfo,
  1930.     (128*16), (128*16),
  1931.     0,
  1932.  
  1933.     VIDEO_TYPE_RASTER | VIDEO_MODIFIES_PALETTE | VIDEO_UPDATE_BEFORE_VBLANK, /* Sprites are buffered too */
  1934.     toaplan2_0_eof_callback,
  1935.     toaplan2_0_vh_start,
  1936.     toaplan2_0_vh_stop,
  1937.     toaplan2_0_vh_screenrefresh,
  1938.  
  1939.     /* sound hardware */
  1940.     0,0,0,0,
  1941.     {
  1942.         {
  1943.             SOUND_YM3812,
  1944.             &ym3812_interface
  1945.         },
  1946.     }
  1947. };
  1948.  
  1949. static struct MachineDriver machine_driver_fixeight =
  1950. {
  1951.     /* basic machine hardware */
  1952.     {
  1953.         {
  1954.             CPU_M68000,
  1955.             16000000,            /* Board has 16Mhz and 27Mhz Oscillators */
  1956.             fixeight_readmem,fixeight_writemem,0,0,
  1957.             toaplan2_interrupt,1
  1958.         },
  1959. #if Zx80
  1960.         {
  1961.             CPU_Z80,            /* Z?80 type Toaplan marked CPU ??? */
  1962.             3500000,
  1963.             Zx80_readmem,Zx80_writemem,0,0,
  1964.             ignore_interrupt,0
  1965.         }
  1966. #endif
  1967.     },
  1968.     60, DEFAULT_REAL_60HZ_VBLANK_DURATION,    /* frames per second, vblank duration */
  1969.     1,
  1970.     init_toaplan3,
  1971.  
  1972.     /* video hardware */
  1973.     32*16, 32*16, { 0, 319, 0, 239 },
  1974.     gfxdecodeinfo,
  1975.     (64*16)+(64*16), (64*16)+(64*16),
  1976.     0,
  1977.  
  1978.     VIDEO_TYPE_RASTER | VIDEO_MODIFIES_PALETTE | VIDEO_UPDATE_BEFORE_VBLANK, /* Sprites are buffered too */
  1979.     toaplan2_0_eof_callback,
  1980.     toaplan2_0_vh_start,
  1981.     toaplan2_0_vh_stop,
  1982.     toaplan2_0_vh_screenrefresh,
  1983.  
  1984.     /* sound hardware */
  1985.     SOUND_SUPPORTS_STEREO,0,0,0,
  1986.     {
  1987.         {
  1988.             SOUND_YM2151,
  1989.             &ym2151_interface
  1990.         }
  1991.     }
  1992. };
  1993.  
  1994. static struct MachineDriver machine_driver_vfive =
  1995. {
  1996.     /* basic machine hardware */
  1997.     {
  1998.         {
  1999.             CPU_M68000,
  2000.             10000000,            /* Board has 20Mhz and 27Mhz Oscillators */
  2001.             vfive_readmem,vfive_writemem,0,0,
  2002.             toaplan2_interrupt,1
  2003.         },
  2004. #if Zx80
  2005.         {
  2006.             CPU_Z80,            /* Z?80 type Toaplan marked CPU ??? */
  2007.             3500000,
  2008.             Zx80_readmem,Zx80_writemem,0,0,
  2009.             ignore_interrupt,0
  2010.         }
  2011. #endif
  2012.     },
  2013.     60, DEFAULT_REAL_60HZ_VBLANK_DURATION,    /* frames per second, vblank duration */
  2014.     1,
  2015.     init_toaplan3,
  2016.  
  2017.     /* video hardware */
  2018.     32*16, 32*16, { 0, 319, 0, 239 },
  2019.     gfxdecodeinfo,
  2020.     (64*16)+(64*16), (64*16)+(64*16),
  2021.     0,
  2022.  
  2023.     VIDEO_TYPE_RASTER | VIDEO_MODIFIES_PALETTE | VIDEO_UPDATE_BEFORE_VBLANK, /* Sprites are buffered too */
  2024.     toaplan2_0_eof_callback,
  2025.     toaplan2_0_vh_start,
  2026.     toaplan2_0_vh_stop,
  2027.     toaplan2_0_vh_screenrefresh,
  2028.  
  2029.     /* sound hardware */
  2030.     SOUND_SUPPORTS_STEREO,0,0,0,
  2031.     {
  2032.         {
  2033.             SOUND_YM2151,
  2034.             &ym2151_interface
  2035.         }
  2036.     }
  2037. };
  2038.  
  2039. static struct MachineDriver machine_driver_batsugun =
  2040. {
  2041.     /* basic machine hardware */
  2042.     {
  2043.         {
  2044.             CPU_M68000,
  2045.             16000000,            /* ??? */
  2046.             batsugun_readmem,batsugun_writemem,0,0,
  2047.             toaplan2_interrupt,1
  2048.         },
  2049. #if Zx80
  2050.         {
  2051.             CPU_Z80,            /* Z?80 type Toaplan marked CPU ??? */
  2052.             3500000,
  2053.             Zx80_readmem,Zx80_writemem,0,0,
  2054.             ignore_interrupt,0
  2055.         }
  2056. #endif
  2057.     },
  2058.     60, DEFAULT_REAL_60HZ_VBLANK_DURATION,    /* frames per second, vblank duration */
  2059.     1,
  2060.     init_toaplan3,
  2061.  
  2062.     /* video hardware */
  2063.     32*16, 32*16, { 0, 319, 0, 239 },
  2064.     gfxdecodeinfo_2,
  2065.     (64*16)+(64*16), (64*16)+(64*16),
  2066.     0,
  2067.  
  2068.     VIDEO_TYPE_RASTER | VIDEO_MODIFIES_PALETTE | VIDEO_UPDATE_BEFORE_VBLANK, /* Sprites are buffered too */
  2069.     toaplan2_1_eof_callback,
  2070.     toaplan2_1_vh_start,
  2071.     toaplan2_1_vh_stop,
  2072.     batsugun_1_vh_screenrefresh,
  2073.  
  2074.     /* sound hardware */
  2075.     SOUND_SUPPORTS_STEREO,0,0,0,
  2076.     {
  2077.         {
  2078.             SOUND_YM2151,
  2079.             &ym2151_interface
  2080.         }
  2081.     }
  2082. };
  2083.  
  2084. static struct MachineDriver machine_driver_snowbro2 =
  2085. {
  2086.     /* basic machine hardware */
  2087.     {
  2088.         {
  2089.             CPU_M68000,
  2090.             16000000,
  2091.             snowbro2_readmem,snowbro2_writemem,0,0,
  2092.             toaplan2_interrupt,1
  2093.         },
  2094.     },
  2095.     60, DEFAULT_REAL_60HZ_VBLANK_DURATION,    /* frames per second, vblank duration */
  2096.     1,
  2097.     init_toaplan2,
  2098.  
  2099.     /* video hardware */
  2100.     32*16, 32*16, { 0, 319, 0, 239 },
  2101.     gfxdecodeinfo,
  2102.     (64*16)+(64*16), (64*16)+(64*16),
  2103.     0,
  2104.  
  2105.     VIDEO_TYPE_RASTER | VIDEO_MODIFIES_PALETTE | VIDEO_UPDATE_BEFORE_VBLANK, /* Sprites are buffered too */
  2106.     toaplan2_0_eof_callback,
  2107.     toaplan2_0_vh_start,
  2108.     toaplan2_0_vh_stop,
  2109.     toaplan2_0_vh_screenrefresh,
  2110.  
  2111.     /* sound hardware */
  2112.     SOUND_SUPPORTS_STEREO,0,0,0,
  2113.     {
  2114.         {
  2115.             SOUND_YM2151,
  2116.             &ym2151_interface
  2117.         },
  2118.         {
  2119.             SOUND_OKIM6295,
  2120.             &okim6295_interface
  2121.         }
  2122.     }
  2123. };
  2124.  
  2125.  
  2126. /***************************************************************************
  2127.  
  2128.   Game driver(s)
  2129.  
  2130. ***************************************************************************/
  2131.  
  2132. ROM_START( tekipaki )
  2133.     ROM_REGION( 0x020000, REGION_CPU1 )            /* Main 68K code */
  2134.     ROM_LOAD_EVEN( "tp020-1.bin", 0x000000, 0x010000, 0xd8420bd5 )
  2135.     ROM_LOAD_ODD ( "tp020-2.bin", 0x000000, 0x010000, 0x7222de8e )
  2136.  
  2137. #if HD64x180
  2138.     ROM_REGION( 0x10000, REGION_CPU2 )            /* Sound 647180 code */
  2139.     /* sound CPU is a HD647180 (Z180) with internal ROM - not yet supported */
  2140.     ROM_LOAD( "hd647180.020", 0x00000, 0x08000, 0x00000000 )
  2141. #endif
  2142.  
  2143.     ROM_REGION( 0x100000, REGION_GFX1 | REGIONFLAG_DISPOSE )
  2144.     ROM_LOAD( "tp020-4.bin", 0x000000, 0x080000, 0x3ebbe41e )
  2145.     ROM_LOAD( "tp020-3.bin", 0x080000, 0x080000, 0x2d5e2201 )
  2146. ROM_END
  2147.  
  2148. ROM_START( ghox )
  2149.     ROM_REGION( 0x040000, REGION_CPU1 )            /* Main 68K code */
  2150.     ROM_LOAD_EVEN( "tp021-01.u10", 0x000000, 0x020000, 0x9e56ac67 )
  2151.     ROM_LOAD_ODD ( "tp021-02.u11", 0x000000, 0x020000, 0x15cac60f )
  2152.  
  2153. #if HD64x180
  2154.     ROM_REGION( 0x10000, REGION_CPU2 )            /* Sound 647180 code */
  2155.     /* sound CPU is a HD647180 (Z180) with internal ROM - not yet supported */
  2156.     ROM_LOAD( "hd647180.021", 0x00000, 0x08000, 0x00000000 )
  2157. #endif
  2158.  
  2159.     ROM_REGION( 0x100000, REGION_GFX1 | REGIONFLAG_DISPOSE )
  2160.     ROM_LOAD( "tp021-03.u36", 0x000000, 0x080000, 0xa15d8e9d )
  2161.     ROM_LOAD( "tp021-04.u37", 0x080000, 0x080000, 0x26ed1c9a )
  2162. ROM_END
  2163.  
  2164. ROM_START( dogyuun )
  2165.     ROM_REGION( 0x080000, REGION_CPU1 )            /* Main 68K code */
  2166.     ROM_LOAD_WIDE( "tp022_1.r16", 0x000000, 0x080000, 0x72f18907 )
  2167.  
  2168. #if Zx80
  2169.     ROM_REGION( 0x10000, REGION_CPU2 )            /* Secondary CPU code */
  2170.     /* Secondary CPU is a Toaplan marked chip ??? */
  2171. //    ROM_LOAD( "tp022.mcu", 0x00000, 0x08000, 0x00000000 )
  2172. #endif
  2173.  
  2174.     ROM_REGION( 0x200000, REGION_GFX1 | REGIONFLAG_DISPOSE )
  2175.     ROM_LOAD_GFX_SWAP( "tp022_3.r16", 0x000000, 0x100000, 0x191b595f )
  2176.     ROM_LOAD_GFX_SWAP( "tp022_4.r16", 0x100000, 0x100000, 0xd58d29ca )
  2177.  
  2178.     ROM_REGION( 0x400000, REGION_GFX2 | REGIONFLAG_DISPOSE )
  2179.     ROM_LOAD_GFX_SWAP( "tp022_5.r16", 0x000000, 0x200000, 0xd4c1db45 )
  2180.     ROM_LOAD_GFX_SWAP( "tp022_6.r16", 0x200000, 0x200000, 0xd48dc74f )
  2181.  
  2182.     ROM_REGION( 0x40000, REGION_SOUND1 )        /* ADPCM Samples */
  2183.     ROM_LOAD( "tp022_2.rom", 0x00000, 0x40000, 0x043271b3 )
  2184. ROM_END
  2185.  
  2186. ROM_START( kbash )
  2187.     ROM_REGION( 0x080000, REGION_CPU1 )            /* Main 68K code */
  2188.     ROM_LOAD_WIDE_SWAP( "kbash01.bin", 0x000000, 0x080000, 0x2965f81d )
  2189.  
  2190.     /* Secondary CPU is a Toaplan marked chip, (TS-004-Dash  TOA PLAN) */
  2191.     /* Its a Z?80 of some sort - 94 pin chip. */
  2192. #if Zx80
  2193.     ROM_REGION( 0x10000, REGION_CPU2 )            /* Sound Z?80 code */
  2194. #else
  2195.     ROM_REGION( 0x8000, REGION_USER1 )
  2196. #endif
  2197.     ROM_LOAD( "kbash02.bin", 0x00200, 0x07e00, 0x4cd882a1 )
  2198.     ROM_CONTINUE(             0x00000, 0x00200 )
  2199.  
  2200.     ROM_REGION( 0x800000, REGION_GFX1 | REGIONFLAG_DISPOSE )
  2201.     ROM_LOAD( "kbash03.bin", 0x000000, 0x200000, 0x32ad508b )
  2202.     ROM_LOAD( "kbash05.bin", 0x200000, 0x200000, 0xb84c90eb )
  2203.     ROM_LOAD( "kbash04.bin", 0x400000, 0x200000, 0xe493c077 )
  2204.     ROM_LOAD( "kbash06.bin", 0x600000, 0x200000, 0x9084b50a )
  2205.  
  2206.     ROM_REGION( 0x40000, REGION_SOUND1 )        /* ADPCM Samples */
  2207.     ROM_LOAD( "kbash07.bin", 0x00000, 0x40000, 0x3732318f )
  2208. ROM_END
  2209.  
  2210. ROM_START( tatsujn2 )
  2211.     ROM_REGION( 0x080000, REGION_CPU1 )            /* Main 68K code */
  2212.     ROM_LOAD_WIDE( "tsj2rom1.bin", 0x000000, 0x080000, 0xf5cfe6ee )
  2213.  
  2214. #if Zx80
  2215.     ROM_REGION( 0x10000, REGION_CPU2 )            /* Secondary CPU code */
  2216.     /* Secondary CPU is a Toaplan marked chip ??? */
  2217. //    ROM_LOAD( "tp024.mcu", 0x00000, 0x08000, 0x00000000 )
  2218. #endif
  2219.  
  2220.     ROM_REGION( 0x200000, REGION_GFX1 | REGIONFLAG_DISPOSE )
  2221.     ROM_LOAD( "tsj2rom4.bin", 0x000000, 0x100000, 0x805c449e )
  2222.     ROM_LOAD( "tsj2rom3.bin", 0x100000, 0x100000, 0x47587164 )
  2223.  
  2224.     ROM_REGION( 0x80000, REGION_SOUND1 )            /* ADPCM Samples */
  2225.     ROM_LOAD( "tsj2rom2.bin", 0x00000, 0x80000, 0xf2f6cae4 )
  2226. ROM_END
  2227.  
  2228. ROM_START( pipibibs )
  2229.     ROM_REGION( 0x040000, REGION_CPU1 )            /* Main 68K code */
  2230.     ROM_LOAD_EVEN( "tp025-1.bin", 0x000000, 0x020000, 0xb2ea8659 )
  2231.     ROM_LOAD_ODD ( "tp025-2.bin", 0x000000, 0x020000, 0xdc53b939 )
  2232.  
  2233.     ROM_REGION( 0x10000, REGION_CPU2 )            /* Sound Z80 code */
  2234.     ROM_LOAD( "tp025-5.bin", 0x0000, 0x8000, 0xbf8ffde5 )
  2235.  
  2236.     ROM_REGION( 0x200000, REGION_GFX1 | REGIONFLAG_DISPOSE )
  2237.     ROM_LOAD( "tp025-4.bin", 0x000000, 0x100000, 0xab97f744 )
  2238.     ROM_LOAD( "tp025-3.bin", 0x100000, 0x100000, 0x7b16101e )
  2239. ROM_END
  2240.  
  2241. ROM_START( whoopee )
  2242.     ROM_REGION( 0x040000, REGION_CPU1 )            /* Main 68K code */
  2243.     ROM_LOAD_EVEN( "whoopee.1", 0x000000, 0x020000, 0x28882e7e )
  2244.     ROM_LOAD_ODD ( "whoopee.2", 0x000000, 0x020000, 0x6796f133 )
  2245.  
  2246.     ROM_REGION( 0x10000, REGION_CPU2 )            /* Sound Z80 code */
  2247.     /* sound CPU is a HD647180 (Z180) with internal ROM - not yet supported */
  2248.     /* use the Z80 version from the bootleg Pipi & Bibis set for now */
  2249.     ROM_LOAD( "hd647180.025", 0x00000, 0x08000, BADCRC( 0x101c0358 ) )
  2250.  
  2251.     ROM_REGION( 0x200000, REGION_GFX1 | REGIONFLAG_DISPOSE )
  2252.     ROM_LOAD( "tp025-4.bin", 0x000000, 0x100000, 0xab97f744 )
  2253.     ROM_LOAD( "tp025-3.bin", 0x100000, 0x100000, 0x7b16101e )
  2254. ROM_END
  2255.  
  2256. ROM_START( pipibibi )
  2257.     ROM_REGION( 0x040000, REGION_CPU1 )            /* Main 68K code */
  2258.     ROM_LOAD_EVEN( "ppbb05.bin", 0x000000, 0x020000, 0x3d51133c )
  2259.     ROM_LOAD_ODD ( "ppbb06.bin", 0x000000, 0x020000, 0x14c92515 )
  2260.  
  2261.     ROM_REGION( 0x10000, REGION_CPU2 )            /* Sound Z80 code */
  2262.     ROM_LOAD( "ppbb08.bin", 0x0000, 0x8000, 0x101c0358 )
  2263.  
  2264.     ROM_REGION( 0x200000, REGION_GFX1 | REGIONFLAG_DISPOSE )
  2265.     ROM_LOAD_GFX_EVEN( "ppbb03.bin", 0x000000, 0x080000, 0xabdd2b8b )
  2266.     ROM_LOAD_GFX_ODD ( "ppbb04.bin", 0x000000, 0x080000, 0x70faa734 )
  2267.     ROM_LOAD_GFX_EVEN( "ppbb02.bin", 0x100000, 0x080000, 0x8bfcdf87 )
  2268.     ROM_LOAD_GFX_ODD ( "ppbb01.bin", 0x100000, 0x080000, 0x0fcae44b )
  2269.  
  2270.     ROM_REGION( 0x8000, REGION_USER1 )            /* ???? */
  2271.     ROM_LOAD( "ppbb07.bin", 0x0000, 0x8000, 0x456dd16e )
  2272. ROM_END
  2273.  
  2274. ROM_START( fixeight )
  2275.     ROM_REGION( 0x080000, REGION_CPU1 )            /* Main 68K code */
  2276.     ROM_LOAD_WIDE_SWAP( "tp-026-1", 0x000000, 0x080000, 0xf7b1746a )
  2277.  
  2278. #if Zx80
  2279.     ROM_REGION( 0x10000, REGION_CPU2 )            /* Secondary CPU code */
  2280.     /* Secondary CPU is a Toaplan marked chip, (TS-001-Turbo  TOA PLAN) */
  2281.     /* Its a Z?80 of some sort - 94 pin chip. */
  2282. //    ROM_LOAD( "tp-026.mcu", 0x0000, 0x8000, 0x00000000 )
  2283. #endif
  2284.  
  2285.     ROM_REGION( 0x400000, REGION_GFX1 | REGIONFLAG_DISPOSE )
  2286.     ROM_LOAD( "tp-026-3", 0x000000, 0x200000, 0xe5578d98 )
  2287.     ROM_LOAD( "tp-026-4", 0x200000, 0x200000, 0xb760cb53 )
  2288.  
  2289.     ROM_REGION( 0x40000, REGION_SOUND1 )        /* ADPCM Samples */
  2290.     ROM_LOAD( "tp-026-2", 0x00000, 0x40000, 0x85063f1f )
  2291.  
  2292.     ROM_REGION( 0x80, REGION_USER1 )
  2293.     /* Serial EEPROM (93C45) connected to Secondary CPU */
  2294.     ROM_LOAD( "93c45.u21", 0x00, 0x80, 0x40d75df0 )
  2295. ROM_END
  2296.  
  2297. ROM_START( vfive )
  2298.     ROM_REGION( 0x080000, REGION_CPU1 )            /* Main 68K code */
  2299.     ROM_LOAD_WIDE( "tp027_01.bin", 0x000000, 0x080000, 0x98dd1919 )
  2300.  
  2301. #if Zx80
  2302.     ROM_REGION( 0x10000, REGION_CPU2 )            /* Sound CPU code */
  2303.     /* Secondary CPU is a Toaplan marked chip, (TS-007-Spy  TOA PLAN) */
  2304.     /* Its a Z?80 of some sort - 94 pin chip. */
  2305. //    ROM_LOAD( "tp027.mcu", 0x8000, 0x8000, 0x00000000 )
  2306. #endif
  2307.  
  2308.     ROM_REGION( 0x200000, REGION_GFX1 | REGIONFLAG_DISPOSE )
  2309.     ROM_LOAD( "tp027_02.bin", 0x000000, 0x100000, 0x877b45e8 )
  2310.     ROM_LOAD( "tp027_03.bin", 0x100000, 0x100000, 0xb1fc6362 )
  2311. ROM_END
  2312.  
  2313. ROM_START( grindstm )
  2314.     ROM_REGION( 0x080000, REGION_CPU1 )            /* Main 68K code */
  2315.     ROM_LOAD_WIDE( "01.bin", 0x000000, 0x080000, 0x99af8749 )
  2316.  
  2317. #if Zx80
  2318.     ROM_REGION( 0x10000, REGION_CPU2 )            /* Sound CPU code */
  2319.     /* Secondary CPU is a Toaplan marked chip, (TS-007-Spy  TOA PLAN) */
  2320.     /* Its a Z?80 of some sort - 94 pin chip. */
  2321. //    ROM_LOAD( "tp027.mcu", 0x8000, 0x8000, 0x00000000 )
  2322. #endif
  2323.  
  2324.     ROM_REGION( 0x200000, REGION_GFX1 | REGIONFLAG_DISPOSE )
  2325.     ROM_LOAD( "tp027_02.bin", 0x000000, 0x100000, 0x877b45e8 )
  2326.     ROM_LOAD( "tp027_03.bin", 0x100000, 0x100000, 0xb1fc6362 )
  2327. ROM_END
  2328.  
  2329. ROM_START( batsugun )
  2330.     ROM_REGION( 0x080000, REGION_CPU1 )            /* Main 68K code */
  2331.     ROM_LOAD_WIDE( "tp030_1.bin", 0x000000, 0x080000, 0xe0cd772b )
  2332.  
  2333. #if Zx80
  2334.     ROM_REGION( 0x10000, REGION_CPU2 )            /* Sound CPU code */
  2335.     /* Secondary CPU is a Toaplan marked chip */
  2336.     /* Its a Z?80 of some sort - 94 pin chip. */
  2337. //    ROM_LOAD( "tp030.mcu", 0x8000, 0x8000, 0x00000000 )
  2338. #endif
  2339.  
  2340.     ROM_REGION( 0x200000, REGION_GFX1 | REGIONFLAG_DISPOSE )
  2341.     ROM_LOAD( "tp030_5.bin",  0x000000, 0x100000, 0xbcf5ba05 )
  2342.     ROM_LOAD( "tp030_6.bin",  0x100000, 0x100000, 0x0666fecd )
  2343.  
  2344.     ROM_REGION( 0x400000, REGION_GFX2 | REGIONFLAG_DISPOSE )
  2345.     ROM_LOAD( "tp030_3l.bin", 0x000000, 0x100000, 0x3024b793 )
  2346.     ROM_LOAD( "tp030_3h.bin", 0x100000, 0x100000, 0xed75730b )
  2347.     ROM_LOAD( "tp030_4l.bin", 0x200000, 0x100000, 0xfedb9861 )
  2348.     ROM_LOAD( "tp030_4h.bin", 0x300000, 0x100000, 0xd482948b )
  2349.  
  2350.     ROM_REGION( 0x40000, REGION_SOUND1 )        /* ADPCM Samples */
  2351.     ROM_LOAD( "tp030_2.bin", 0x00000, 0x40000, 0x276146f5 )
  2352. ROM_END
  2353.  
  2354. ROM_START( snowbro2 )
  2355.     ROM_REGION( 0x080000, REGION_CPU1 )            /* Main 68K code */
  2356.     ROM_LOAD_WIDE_SWAP( "pro-4", 0x000000, 0x080000, 0x4c7ee341 )
  2357.  
  2358.     ROM_REGION( 0x300000, REGION_GFX1 | REGIONFLAG_DISPOSE )
  2359.     ROM_LOAD( "rom2-l", 0x000000, 0x100000, 0xe9d366a9 )
  2360.     ROM_LOAD( "rom2-h", 0x100000, 0x080000, 0x9aab7a62 )
  2361.     ROM_LOAD( "rom3-l", 0x180000, 0x100000, 0xeb06e332 )
  2362.     ROM_LOAD( "rom3-h", 0x280000, 0x080000, 0xdf4a952a )
  2363.  
  2364.     ROM_REGION( 0x80000, REGION_SOUND1 )        /* ADPCM Samples */
  2365.     ROM_LOAD( "rom4", 0x00000, 0x80000, 0x638f341e )
  2366. ROM_END
  2367.  
  2368.  
  2369.  
  2370. /* The following is in order of Toaplan Board/game numbers */
  2371. /* See list at top of file */
  2372. /* Whoopee machine to be changed to Teki Paki when (if) HD647180 is dumped */
  2373.  
  2374. /*     ( YEAR    NAME     PARENT    MACHINE   INPUT      INIT     MONITOR     COMPANY    FULLNAME     FLAGS ) */
  2375. GAMEX( 1991, tekipaki, 0,        tekipaki, tekipaki, toaplan2, ROT0,         "Toaplan", "Teki Paki", GAME_NO_SOUND )
  2376. GAMEX( 1991, ghox,     0,        ghox,     ghox,     toaplan2, ROT270,       "Toaplan", "Ghox", GAME_NO_SOUND )
  2377. GAMEX( 1991, dogyuun,  0,        dogyuun,  dogyuun,  toaplan3, ROT270,       "Toaplan", "Dogyuun", GAME_NO_SOUND )
  2378. GAMEX( 1993, kbash,    0,        kbash,    kbash,    toaplan2, ROT0_16BIT,   "Toaplan", "Knuckle Bash", GAME_NO_SOUND )
  2379. GAMEX( 1992, tatsujn2, 0,        tatsujn2, vfive,    toaplan3, ROT270,       "Toaplan", "Truxton II / Tatsujin II (Japan)", GAME_NOT_WORKING )
  2380. GAME ( 1991, pipibibs, 0,        pipibibs, pipibibs, pipibibs, ROT0,         "Toaplan", "Pipi & Bibis / Whoopee (Japan)" )
  2381. GAMEX( 1991, pipibibi, pipibibs, pipibibs, pipibibs, pipibibs, ROT0,         "bootleg?", "Pipi & Bibis / Whoopee (Japan) [bootleg ?]", GAME_NOT_WORKING )
  2382. GAME ( 1991, whoopee,  pipibibs, whoopee,  whoopee,  pipibibs, ROT0,         "Toaplan", "Whoopee (Japan) / Pipi & Bibis (World)" )
  2383. GAMEX( 1992, fixeight, 0,        fixeight, vfive,    toaplan3, ROT270,       "Toaplan", "FixEight", GAME_NOT_WORKING )
  2384. GAMEX( 1993, vfive,    0,        vfive,    vfive,    toaplan3, ROT270,       "Toaplan", "V-Five (Japan)", GAME_NO_SOUND )
  2385. GAMEX( 1993, grindstm, vfive,    vfive,    vfive,    toaplan3, ROT270,       "Toaplan (Unite Trading license)", "Grind Stormer (Korea)", GAME_NO_SOUND )
  2386. GAMEX( 1993, batsugun, 0,        batsugun, batsugun, toaplan3, ROT270_16BIT, "Toaplan", "Batsugun", GAME_NO_SOUND )
  2387. GAME ( 1994, snowbro2, 0,        snowbro2, snowbro2, snowbro2, ROT0_16BIT,   "[Toaplan] Hanafram", "Snow Bros. 2 - With New Elves" )
  2388.  
  2389.